mirror of https://github.com/xzeldon/htop.git
Check btime sscanf parse from /proc/stat
Found by Coverity
This commit is contained in:
parent
a850d81bf5
commit
5c99c6e942
|
@ -275,7 +275,8 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
|
||||||
} else if (String_startsWith(buffer, "cpu")) {
|
} else if (String_startsWith(buffer, "cpu")) {
|
||||||
cpus++;
|
cpus++;
|
||||||
} else if (String_startsWith(buffer, "btime ")) {
|
} else if (String_startsWith(buffer, "btime ")) {
|
||||||
sscanf(buffer, "btime %lld\n", &btime);
|
if (sscanf(buffer, "btime %lld\n", &btime) != 1)
|
||||||
|
CRT_fatalError("Failed to parse btime from " PROCSTATFILE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while(true);
|
} while(true);
|
||||||
|
|
Loading…
Reference in New Issue