From 5412ec6e3f1a5ee0b1e851d298ae646c9fb02162 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Wed, 20 Apr 2016 01:39:31 +0000 Subject: [PATCH] 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 --- 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 5f2ef71b95da..740aea8734c8 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; }