diff options
author | Jim Meyering <meyering@redhat.com> | 2010-03-26 11:34:27 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-03-27 10:11:58 +0100 |
commit | 54d55bba41f2ff31682fe6523ef6f49b37a0e20f (patch) | |
tree | 738f59cb8c03446a3ad49fb15677003bd86552e6 /lib | |
parent | 0b027cfbadb1c01152c552927352b9e06f5241fc (diff) | |
download | grep-54d55bba41f2ff31682fe6523ef6f49b37a0e20f.tar.gz |
grep: don't segfault upon use of --include or --exclude* options
* lib/savedir.c (isdir1): Fix fatal typo: deref "dir" argument,
not the global (initially-NULL) "path". Reported by Standish Parsley.
* tests/include-exclude: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/savedir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/savedir.c b/lib/savedir.c index 91fd77b9..94e5f121 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -48,7 +48,7 @@ isdir1 (const char *dir, const char *file) size_t dirlen = strlen (dir); size_t filelen = strlen (file); - while (dirlen && path[dirlen - 1] == '/') + while (dirlen && dir[dirlen - 1] == '/') dirlen--; if ((dirlen + filelen + 2) > pathlen) |