cache: fix up a corner case in r307650

If no negative entry is found on the last list, the ncp pointer will be
left uninitialized and a non-null value will make the function assume an
entry was found.

Fix the problem by initializing to NULL on entry.

Reported by:	glebius
This commit is contained in:
mjg 2016-10-20 19:55:50 +00:00
parent 8dfb293335
commit 75b7de1b56

View File

@ -763,6 +763,8 @@ cache_negative_shrink_select(int start, struct namecache **ncpp,
struct namecache *ncp;
int i;
*ncpp = ncp = NULL;
for (i = start; i < numneglists; i++) {
neglist = &neglists[i];
if (TAILQ_FIRST(&neglist->nl_list) == NULL)