mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-27 01:44:21 +00:00
kill: port to picky-conversion hosts
* src/kill.c (send_signals): Don’t rely on conversion overflow being silent.
This commit is contained in:
parent
728f3baa50
commit
9062704bf8
@ -199,9 +199,10 @@ send_signals (int signum, char *const *argv)
|
||||
{
|
||||
char *endp;
|
||||
intmax_t n = (errno = 0, strtoimax (arg, &endp, 10));
|
||||
pid_t pid = n;
|
||||
pid_t pid;
|
||||
|
||||
if (errno == ERANGE || pid != n || arg == endp || *endp)
|
||||
if (errno == ERANGE || INT_ADD_WRAPV (n, 0, &pid)
|
||||
|| arg == endp || *endp)
|
||||
{
|
||||
error (0, 0, _("%s: invalid process id"), quote (arg));
|
||||
status = EXIT_FAILURE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user