mirror of
git://git.sv.gnu.org/findutils.git
synced 2026-01-27 20:23:20 +01:00
Fixes Savannah bug #8623 (failure to check consistency of data read from locate database)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user