stalld: Add error handling in get_cpu_idle_time()

We have two functions, strstr and strtol, that are missing error handling paths within get_cpu_idle_time. Of particular concern is the function strstr which can return NULL. Meaning we can find ourselves hitting an invalid dereference.

We also commit get_cpu_idle_time to return a negative value on error.

Signed-off-by: Fernando Pacheco fpacheco@redhat.com

Edited by Fernando Pacheco

Merge request reports

Loading