DragonFlyBSD Kernel Audit
DF-0699 / fix.diff
← back to finding ↓ download raw
diff --git a/netgraph/bpf/ng_bpf.c b/netgraph/bpf/ng_bpf.c
--- a/netgraph/bpf/ng_bpf.c
+++ b/netgraph/bpf/ng_bpf.c
@@ -414,7 +414,7 @@
 		/* Truncate packet length if required by the filter */
 		if (len < totlen) {
 			m_adj(m, -(totlen - len));
-			totlen -= len;
+			totlen = len;
 		}
 		dest = ng_findhook(hip->node, hip->prog->ifMatch);
 	} else