From a3f81dfa47d6f592b378d189d9477f319c355b24 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 13 May 2016 08:04:57 +0000 Subject: [PATCH] MFC r298328: r298328 (by cem): 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. CID: 1352743 git-svn-id: svn://svn.freebsd.org/base/stable/10@299615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/net/bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index c40e29fd9..63426e7a2 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -2643,7 +2643,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; } -- 2.45.0