From 84365e2bcbbfaafd319c4fe90eeed7a0e41702f0 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 23 Mar 2000 18:58:59 +0000 Subject: [PATCH] Fix parens in m_pullup() line in arp handling code. The code was improperly doing the equivalent of (m = (function() == NULL)) instead of ((m = function()) == NULL). This fixes a NULL pointer dereference panic with runt arp packets. --- sys/netinet/if_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 495a554eba4..7fbcd904612 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -444,7 +444,7 @@ arpintr() panic("arpintr"); if (m->m_len < sizeof(struct arphdr) && - (m = m_pullup(m, sizeof(struct arphdr)) == NULL)) { + ((m = m_pullup(m, sizeof(struct arphdr))) == NULL)) { log(LOG_ERR, "arp: runt packet -- m_pullup failed."); continue; }