2 ms·
This isn't a TOCTOU problem. This is a problem of using sentinel values to mean other things, when those sentinel values won't ever get returned by getpid(), bu
by kelnos 2y ago
This isn't a TOCTOU problem. This is a problem of using sentinel values to mean other things, when those sentinel values won't ever get returned by getpid(), but kill() will accept those values and do something you didn't intend.
The fix was to check if the PID variable was set to one of the sentinel values, and not call kill() at all if that's what they are.