Don't crash when we have an invalid count number.

PR:		bin/32686
Submitted by:	Jaakko Heinonen <jh saunalahti.fi>
MFC after:	1 week
This commit is contained in:
Xin LI 2009-04-02 21:23:04 +00:00
parent 0e875ecafe
commit ab85842c90

View File

@ -216,6 +216,8 @@ fastfind
count += c - OFFSET;
}
if (count < 0 || count > MAXPATHLEN)
errx(1, "corrupted database: %s", database);
/* overlay old path */
p = path + count;
foundchar = p - 1;