Skip to content

Commit 5f0d7bb

Browse files
timschumiSebaUbuntu
authored andcommitted
megvii: Return a char pointer for some stubs instead
`mg_facepp[3]` and `mg_facepp[4]` seem to return version strings, which occasionally get logged if the return value is non-zero. Return a dummy string for those functions to avoid crashing in strlen. Change-Id: Icc5d2ab2f72c480f03e652e3849aceaf4cfb498b
1 parent ec5d5b0 commit 5f0d7bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

megvii/megvii.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ static int stub_fail() {
88
return -1;
99
}
1010

11+
static char *stub_fail_str() {
12+
return "stub";
13+
}
14+
1115
void *mg_facepp[] = {
1216
&stub_fail,
1317
&stub_fail,
1418
&stub_fail,
15-
&stub_fail,
16-
&stub_fail,
19+
&stub_fail_str,
20+
&stub_fail_str,
1721
&stub_fail,
1822
&stub_fail,
1923
&stub_fail,

0 commit comments

Comments
 (0)