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:
parent
6b1c46441c
commit
5412ec6e3f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298328
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user