DragonFlyBSD Kernel Audit
DF-0446 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -716,7 +716,7 @@
 		/*
 		 * Set the interface MTU.
 		 */
-		if (ifr->ifr_mtu > ETHERMTU) {
+		if (ifr->ifr_mtu > ETHERMTU || ifr->ifr_mtu <= 0) {
 			error = EINVAL;
 		} else {
 			ifp->if_mtu = ifr->ifr_mtu;