Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105944453
D9887.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
634 B
Referenced Files
None
Subscribers
None
D9887.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9887: Don't kill pid -1 on overflow from strtol(3).
Attached
Detach File
Event Timeline
Log In to Comment