mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
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")) {
|
||||
cpus++;
|
||||
} 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;
|
||||
}
|
||||
} while(true);
|
||||
|
Loading…
Reference in New Issue
Block a user