pkg: fix out-of-boundary write caused by realloc() semantics
parent
29ca5b7eee
commit
4d027a4366
2
pkg.c
2
pkg.c
|
@ -51,7 +51,7 @@ path_split(const char *text, char ***parv)
|
||||||
(*parv)[count] = strdup(p);
|
(*parv)[count] = strdup(p);
|
||||||
count++, iter = NULL;
|
count++, iter = NULL;
|
||||||
|
|
||||||
*parv = realloc(*parv, sizeof (void *) * count);
|
*parv = realloc(*parv, sizeof (void *) * (count + 1));
|
||||||
}
|
}
|
||||||
free(workbuf);
|
free(workbuf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue