Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
sysstat
sysstat-fix-segfault-in-read_task_stats.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sysstat-fix-segfault-in-read_task_stats.patch of Package sysstat
Index: sysstat-12.0.2/pidstat.c =================================================================== --- sysstat-12.0.2.orig/pidstat.c +++ sysstat-12.0.2/pidstat.c @@ -970,6 +970,16 @@ void read_task_stats(int curr, unsigned return; while ((drp = readdir(dir)) != NULL) { + + // read_task_stats might be called by read_stats + // while in the last pid entry, therefore *index + // can be greater than pid_nr. In that case, let's + // realloc before attempting to write to it later + // when read_pid_stats() is called + if (*index >= pid_nr) { + realloc_pid(); + } + if (!isdigit(drp->d_name[0])) { continue; } @@ -980,9 +990,6 @@ void read_task_stats(int curr, unsigned pst->pid = 0; } - if (*index >= pid_nr) { - realloc_pid(); - } } closedir(dir);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor