mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 19:30:29 +00:00
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:
parent
758cdb72da
commit
90f19ed448
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue