summaryrefslogtreecommitdiff
path: root/lib/libc/gen/basename.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2001-06-28 04:27:20 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2001-06-28 04:27:20 +0000
commit51d9bd1d6a4026864be0e5ccde66fec174fc8f89 (patch)
treeb55444e1a682d20a41a5a230a9abbe5be75cda48 /lib/libc/gen/basename.c
parentfc5897e34873a801e6fe167714cc7487fb99a336 (diff)
fix one-byte overflows
Diffstat (limited to 'lib/libc/gen/basename.c')
-rw-r--r--lib/libc/gen/basename.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/basename.c b/lib/libc/gen/basename.c
index 9126b5a1166..7707cdb52bf 100644
--- a/lib/libc/gen/basename.c
+++ b/lib/libc/gen/basename.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basename.c,v 1.5 2001/06/27 00:58:54 lebel Exp $ */
+/* $OpenBSD: basename.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: basename.c,v 1.5 2001/06/27 00:58:54 lebel Exp $";
+static char rcsid[] = "$OpenBSD: basename.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $";
#endif /* not lint */
#include <errno.h>
@@ -65,7 +65,7 @@ basename(path)
while (startp > path && *(startp - 1) != '/')
startp--;
- if (endp - startp + 1 > sizeof(bname)) {
+ if (endp - startp + 2 > sizeof(bname)) {
errno = ENAMETOOLONG;
return(NULL);
}