From 6481f66b9079fd86ecb041e6760fb23bfb1de087 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 28 Jun 2016 20:10:30 +0000 Subject: [PATCH] Do not coredump if the packet is too long in the global (non-interface associated) instance. The result is that the packet is dropped without an indication that smaller MTU is advisable, which is not optimal, but better than a NULL pointer deref. Approved by: re (glebius) --- sbin/natd/natd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index 894e82467f9..aa1628a6312 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -618,7 +618,7 @@ static void DoGlobal (int fd) if (wrote != bytes) { - if (errno == EMSGSIZE) { + if (errno == EMSGSIZE && mip != NULL) { if (mip->ifMTU != -1) SendNeedFragIcmp (icmpSock,