diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-09-25 15:29:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-09-25 15:29:07 +0000 |
commit | f45e4341b61de40bafefc069d56d942a99b4581c (patch) | |
tree | a6f64b52967e698e7ada538f639a0f4a701bb8ed | |
parent | b5155bbccc0f293acc00282358e46df1a808007e (diff) |
Fix a bug where one byte past the end of a buffer could be touched
in certain cases; closes PR 3163
-rw-r--r-- | bin/csh/dir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/csh/dir.c b/bin/csh/dir.c index e1dd57294c3..5b658c45552 100644 --- a/bin/csh/dir.c +++ b/bin/csh/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.12 2003/06/11 21:09:50 deraadt Exp $ */ +/* $OpenBSD: dir.c,v 1.13 2003/09/25 15:29:06 millert Exp $ */ /* $NetBSD: dir.c,v 1.9 1995/03/21 09:02:42 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: dir.c,v 1.12 2003/06/11 21:09:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dir.c,v 1.13 2003/09/25 15:29:06 millert Exp $"; #endif #endif /* not lint */ @@ -651,8 +651,8 @@ dcanon(Char *cp, Char *p) continue; p = sp; /* save start of component */ slash = 0; - while (*++p) /* find next slash or end of path */ - if (*p == '/') { + while (*p) /* find next slash or end of path */ + if (*++p == '/') { slash = 1; *p = 0; break; |