From 51d9bd1d6a4026864be0e5ccde66fec174fc8f89 Mon Sep 17 00:00:00 2001 From: Paul Janzen Date: Thu, 28 Jun 2001 04:27:20 +0000 Subject: fix one-byte overflows --- lib/libc/gen/basename.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libc/gen/basename.c') 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 @@ -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 @@ -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); } -- cgit v1.2.3