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:
parent
015669383f
commit
920b0ada70
@ -524,7 +524,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
|
|||||||
int need_vmstat_file = 0;
|
int need_vmstat_file = 0;
|
||||||
int need_proc_scan = 0;
|
int need_proc_scan = 0;
|
||||||
const char* b;
|
const char* b;
|
||||||
buff[BUFFSIZE-1] = 0; /* ensure null termination in buffer */
|
memset(buff, '\0', BUFFSIZE); /* ensure null termination in buffer */
|
||||||
|
|
||||||
if(fd){
|
if(fd){
|
||||||
lseek(fd, 0L, SEEK_SET);
|
lseek(fd, 0L, SEEK_SET);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user