DragonFlyBSD Kernel Audit
DF-1336 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c
--- a/sys/dev/netif/re/if_re.c
+++ b/sys/dev/netif/re/if_re.c
@@ -1206,7 +1206,7 @@
 		}
 
 		if (sc->re_head != NULL) {
-			m->m_len = total_len % MCLBYTES;
+			m->m_len = (total_len % MCLBYTES == 0) ? MCLBYTES : (total_len % MCLBYTES);
 			/* 
 			 * Special case: if there's 4 bytes or less
 			 * in this buffer, the mbuf can be discarded: