diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-08-28 15:34:24 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-08-28 16:46:50 +0200 |
commit | 5c99c6e942d5346bdac77d11eece9e2d60db4191 (patch) | |
tree | e8ef57d13a187cb31ea3d56a02af4dbc927607e7 | |
parent | a850d81bf507b7a3281c89f503ee8e7963f6772f (diff) |
Check btime sscanf parse from /proc/stat
Found by Coverity
-rw-r--r-- | linux/LinuxProcessList.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index afdbc5fd..e426785f 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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); |