diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-27 15:12:15 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-01-30 14:21:26 +0100 |
commit | 7bfa466abe65ff14d530ae16c344cdc06d5145ea (patch) | |
tree | 15a6fb8c26887bd8f5b13ceda4d2460f4c5409f0 /linux/LinuxProcessList.c | |
parent | 1014e897a7faa9556aa0ce54237c3d6c8163d023 (diff) |
Linux: silence UBSAN implicit conversions
pgrp and session might be -1
linux/LinuxProcessList.c:312:20: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:312:20 in
linux/LinuxProcessList.c:314:23: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:314:23 in
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 5c15c2e1..081b31e0 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -316,11 +316,11 @@ static bool LinuxProcessList_readStatFile(Process* process, openat_arg_t procFd, location += 1; /* (5) pgrp - %d */ - process->pgrp = strtoul(location, &location, 10); + process->pgrp = strtol(location, &location, 10); location += 1; /* (6) session - %d */ - process->session = strtoul(location, &location, 10); + process->session = strtol(location, &location, 10); location += 1; /* (7) tty_nr - %d */ |