Page MenuHomeFreeBSD

D9887.diff
No OneTemporary

D9887.diff

Index: head/bin/kill/kill.c
===================================================================
--- head/bin/kill/kill.c
+++ head/bin/kill/kill.c
@@ -66,7 +66,9 @@
int
main(int argc, char *argv[])
{
- int errors, numsig, pid, ret;
+ long pidl;
+ pid_t pid;
+ int errors, numsig, ret;
char *ep;
if (argc < 2)
@@ -137,8 +139,10 @@
else
#endif
{
- pid = strtol(*argv, &ep, 10);
- if (!**argv || *ep)
+ pidl = strtol(*argv, &ep, 10);
+ /* Check for overflow of pid_t. */
+ pid = (pid_t)pidl;
+ if (!**argv || *ep || pid != pidl)
errx(2, "illegal process id: %s", *argv);
ret = kill(pid, numsig);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 10:28 PM (18 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15580481
Default Alt Text
D9887.diff (634 B)

Event Timeline