summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Youngman <jay@gnu.org>2011-06-14 00:19:22 +0100
committerJames Youngman <jay@gnu.org>2011-06-14 00:19:22 +0100
commit30056f0b4fa922b54cdd2747f29af67e2c729894 (patch)
treec516bf6e547fb57327b0b729bf7827b7c4729faa
parentfce18654244a4ad55ed51f5e8adae1db5ff7555b (diff)
downloadfindutils-30056f0b4fa922b54cdd2747f29af67e2c729894.tar.gz
Fix coredump bug introduced in the previous change.
* locate/locate.c (dolocate): Remove declaration of e, which was replaced by the variable db_name. Change the last two uses of 'e' to use 'db_name'. This bugfix prevents possible coredumps when issuing error messages about reads from the locate database (or warnings about byte order for old databases). This bug had been introduced in the previous change.
-rw-r--r--ChangeLog10
-rw-r--r--locate/locate.c5
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b2dd521..3a1ae3be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-06-14 James Youngman <jay@gnu.org>
+
+ Fix coredump bug introduced in the previous change.
+ * locate/locate.c (dolocate): Remove declaration of e, which was
+ replaced by the variable db_name. Change the last two uses of 'e'
+ to use 'db_name'. This bugfix prevents possible coredumps when
+ issuing error messages about reads from the locate database (or
+ warnings about byte order for old databases). This bug had been
+ introduced in the previous change.
+
2011-06-13 James Youngman <jay@gnu.org>
Split strings into fields nondestructively.
diff --git a/locate/locate.c b/locate/locate.c
index 42089eeb..611b18d4 100644
--- a/locate/locate.c
+++ b/locate/locate.c
@@ -1570,7 +1570,6 @@ dolocate (int argc, char **argv, int secure_db_fd)
int regex_options = RE_SYNTAX_EMACS;
int stats = 0;
int op_and = 0;
- const char *e;
FILE *fp;
int they_chose_db = 0;
bool did_stdin = false; /* Set to prevent rereading stdin. */
@@ -1785,7 +1784,7 @@ dolocate (int argc, char **argv, int secure_db_fd)
}
else
{
- e = "<stdin>";
+ db_name = "<stdin>";
fd = 0;
did_stdin = true;
}
@@ -1879,7 +1878,7 @@ dolocate (int argc, char **argv, int secure_db_fd)
/* Search this database for all patterns simultaneously */
found = search_one_database (argc - optind, &argv[optind],
- e, fp, filesize,
+ db_name, fp, filesize,
ignore_case, print, basename_only,
use_limit, &limits, stats,
op_and, regex, regex_options);