Fixes Savannah bug #8623 (failure to check consistency of data read from locate database)

This commit is contained in:
James Youngman
2004-05-03 10:08:59 +00:00
parent ca27bb5667
commit 5474abc2d1

View File

@@ -374,6 +374,15 @@ locate (pathpart, dbfile, ignore_case)
else
count += c;
if (count > strlen(path))
{
/* This should not happen generally , but since we're
* reading in data which is outside our control, we
* cannot prevent it.
*/
error(1, 0, _("locate database `%s' is corrupt or invalid"), dbfile);
}
/* Overlay the old path with the remainder of the new. */
nread = locate_read_str (&path, &pathsize, fp, 0, count);
if (nread < 0)