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: v6.11.6~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=229e6ce549bfc738c7d09a98dc3dc77a716dc18e;p=thirdparty%2Fdhcpcd.git Fix a potential crash where the DHCP state could be freed during processing. --- diff --git a/dhcp.c b/dhcp.c index aa19b082..9f019083 100644 --- a/dhcp.c +++ b/dhcp.c @@ -3223,6 +3223,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; } }