proc/sysinfo.c: Ensure null-termination in getstat().

There was a "buff[BUFFSIZE-1] = 0;" but there may be garbage between
what is read() (less than BUFFSIZE-1 bytes) and this null byte. Reuse
the construct from the preceding getrunners().
This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent 015669383f
commit 920b0ada70

View File

@ -524,7 +524,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
int need_vmstat_file = 0;
int need_proc_scan = 0;
const char* b;
buff[BUFFSIZE-1] = 0; /* ensure null termination in buffer */
memset(buff, '\0', BUFFSIZE); /* ensure null termination in buffer */
if(fd){
lseek(fd, 0L, SEEK_SET);