提交 03de77f5 编写于 作者: R Rich Felker

avoid null pointer dereference on %*p fields in scanf

上级 b7a27617
...@@ -284,7 +284,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap) ...@@ -284,7 +284,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
int_common: int_common:
x = __intscan(f, base, 0, ULLONG_MAX); x = __intscan(f, base, 0, ULLONG_MAX);
if (!shcnt(f)) goto match_fail; if (!shcnt(f)) goto match_fail;
if (t=='p') *(void **)dest = (void *)(uintptr_t)x; if (t=='p' && dest) *(void **)dest = (void *)(uintptr_t)x;
else store_int(dest, size, x); else store_int(dest, size, x);
break; break;
case 'a': case 'A': case 'a': case 'A':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册