shlock(1) - Fix a possible overflow.
authorGwenio <gwenio@live.com>
Sat, 9 Mar 2013 11:28:05 +0000 (12:28 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sat, 9 Mar 2013 11:28:05 +0000 (12:28 +0100)
usr.bin/shlock/shlock.c

index ca7c292..9f33f56 100644 (file)
@@ -234,7 +234,7 @@ check_lock(const char *file, int uucpstyle, int debug)
                        return(1);
                }
 
-               buf[BUFSIZE] = '\0';
+               buf[BUFSIZE - 1] = '\0';
                errno = 0;
                tmp_pid = strtol(buf, &endptr, 10);
                if ((*endptr != '\0' && *endptr != '\n') || errno ||