proc/readproc.c: Harden openproc().
Replace xmalloc() with xcalloc().
This commit is contained in:
parent
19849a45e0
commit
a4d82a2c2c
@ -1413,7 +1413,7 @@ PROCTAB* openproc(int flags, ...) {
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
static int did_stat;
|
static int did_stat;
|
||||||
PROCTAB* PT = xmalloc(sizeof(PROCTAB));
|
PROCTAB* PT = xcalloc(sizeof(PROCTAB));
|
||||||
|
|
||||||
if (!did_stat){
|
if (!did_stat){
|
||||||
task_dir_missing = stat("/proc/self/task", &sbuf);
|
task_dir_missing = stat("/proc/self/task", &sbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user