]> granicus.if.org Git - procps-ng/commitdiff
proc/readproc.c: Harden openproc().
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 21:32:22 +0000 (07:32 +1000)
Replace xmalloc() with xcalloc().

proc/readproc.c

index de69cdad8500efb475fe62b8b9e5db60ec98f750..03014b624736a96aa524eb10080b408d9959321d 100644 (file)
@@ -1413,7 +1413,7 @@ PROCTAB* openproc(int flags, ...) {
     va_list ap;
     struct stat sbuf;
     static int did_stat;
-    PROCTAB* PT = xmalloc(sizeof(PROCTAB));
+    PROCTAB* PT = xcalloc(sizeof(PROCTAB));
 
     if (!did_stat){
         task_dir_missing = stat("/proc/self/task", &sbuf);