mirror of
git://git.musl-libc.org/musl
synced 2025-04-01 22:48:38 +00:00
avoid null pointer dereference on %*p fields in scanf
This commit is contained in:
parent
b7a2761780
commit
03de77f521
@ -284,7 +284,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
|
||||
int_common:
|
||||
x = __intscan(f, base, 0, ULLONG_MAX);
|
||||
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);
|
||||
break;
|
||||
case 'a': case 'A':
|
||||
|
Loading…
Reference in New Issue
Block a user