From 229e6ce549bfc738c7d09a98dc3dc77a716dc18e Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 27 Mar 2017 16:01:52 +0100 Subject: [PATCH] Fix a potential crash where the DHCP state could be freed during processing. --- dhcp.c | 3 +++ 1 file changed, 3 insertions(+) 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; } } -- 2.47.2