DragonFlyBSD Kernel Audit
DF-1383 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/netif/tl/if_tl.c b/sys/dev/netif/tl/if_tl.c
--- a/sys/dev/netif/tl/if_tl.c
+++ b/sys/dev/netif/tl/if_tl.c
@@ -1795,6 +1795,9 @@
 		if (frag == TL_MAXFRAGS) {
 			if_printf(&sc->arpcom.ac_if, "all frags filled but "
 				  "frame still to small!\n");
+			/* Cannot append a pad fragment without overflowing
+			 * tl_frag[TL_MAXFRAGS=10]. */
+			return (1);
 		}
 		f = &c->tl_ptr->tl_frag[frag];
 		f->tlist_dcnt = TL_MIN_FRAMELEN - total_len;