diff options
author | Matt Kraai <kraai@debian.org> | 2001-04-19 14:56:23 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-04-19 14:56:23 +0000 |
commit | 3ce79338e66d37e9313c0a4bde78d21822402c09 (patch) | |
tree | b1a5c48ecb4135a1ada29cead4b92058e51e55e2 | |
parent | 0a3bda2c53c26f59a4633118cb1df2b911d0d96b (diff) | |
download | busybox-3ce79338e66d37e9313c0a4bde78d21822402c09.tar.gz |
Fix buffer underrun noted and solved by Larry Doolittle.
-rw-r--r-- | coreutils/dirname.c | 2 | ||||
-rw-r--r-- | dirname.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 8313e99c6..935a8313c 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -37,7 +37,7 @@ extern int dirname_main(int argc, char **argv) argv++; s=*argv+strlen(*argv)-1; - while (s != *argv && *s == '/') { + while (s > *argv && *s == '/') { *s-- = '\0'; } s = strrchr(*argv, '/'); @@ -37,7 +37,7 @@ extern int dirname_main(int argc, char **argv) argv++; s=*argv+strlen(*argv)-1; - while (s != *argv && *s == '/') { + while (s > *argv && *s == '/') { *s-- = '\0'; } s = strrchr(*argv, '/'); |