vcscanf: ensure buf is NULL after string decoding

The presence of a pointer in buf could result in double free bugs
when execution reaches the end of the function and it is freed.
This commit is contained in:
Matheus Afonso Martins Moreira 2023-11-02 06:47:45 -03:00
parent 758cdb72da
commit 90f19ed448

View file

@ -540,6 +540,7 @@ int __vcscanf(int callback(void *), //
if (ismalloc) {
*va_arg(va, char **) = (void *) buf;
}
buf = NULL;
} else {
do {
if (isspace(c)) break;