proc/readproc.c: Harden openproc().

Replace xmalloc() with xcalloc().
This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent 19849a45e0
commit a4d82a2c2c

View File

@ -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);