From: Roy Marples Date: Mon, 27 Mar 2017 15:01:52 +0000 (+0100) Subject: Fix a potential crash where the DHCP state could be freed during processing. X-Git-Tag: v7.0.0-beta1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cc7cf79e6e0ca61c654e6a34f78cc483387bee6;p=thirdparty%2Fdhcpcd.git Fix a potential crash where the DHCP state could be freed during processing. --- diff --git a/src/dhcp.c b/src/dhcp.c index f6b3104e..0e32665e 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -3267,6 +3267,9 @@ dhcp_readpacket(void *arg) return; } dhcp_handlepacket(ifp, buf, (size_t)bytes, flags); + /* Check we still have a state after processing. */ + if ((state = D_CSTATE(ifp)) == NULL || state->bpf_fd == -1) + break; } }