summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2016-04-20 01:39:31 +0000
committercem <cem@FreeBSD.org>2016-04-20 01:39:31 +0000
commit9904129a9f1c0d27452c71d567519c51ca61e673 (patch)
tree6ab4138c21ce4380317ccb31fca82317b6944f1a /sys/net
parent5329b494a9ff957d23e1bc526113796015e85f88 (diff)
downloadFreeBSD-src-9904129a9f1c0d27452c71d567519c51ca61e673.zip
FreeBSD-src-9904129a9f1c0d27452c71d567519c51ca61e673.tar.gz
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
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 5f2ef71..740aea8 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -2739,7 +2739,7 @@ again:
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;
}
OpenPOWER on IntegriCloud