bpf_getdltlist: Don't overrun 'lst'

'lst' is allocated with 'n1' members.  'n' indexes 'lst'.  So 'n == n1' is an
invalid 'lst' index.  This is a follow-up to r296009.

Reported by:	Coverity
CID:		1352743
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
cem 2016-04-20 01:39:31 +00:00
parent 5329b494a9
commit 9904129a9f

View File

@ -2739,7 +2739,7 @@ bpf_getdltlist(struct bpf_d *d, struct bpf_dltlist *bfl)
LIST_FOREACH(bp, &bpf_iflist, bif_next) {
if (bp->bif_ifp != ifp)
continue;
if (n > n1) {
if (n >= n1) {
free(lst, M_TEMP);
goto again;
}