diff options
author | cem <cem@FreeBSD.org> | 2016-04-20 01:39:31 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2016-04-20 01:39:31 +0000 |
commit | 9904129a9f1c0d27452c71d567519c51ca61e673 (patch) | |
tree | 6ab4138c21ce4380317ccb31fca82317b6944f1a /sys/net | |
parent | 5329b494a9ff957d23e1bc526113796015e85f88 (diff) | |
download | FreeBSD-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.c | 2 |
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; } |