]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a potential crash where the ARP state could be freed during processing.
authorRoy Marples <roy@marples.name>
Mon, 27 Mar 2017 14:56:34 +0000 (15:56 +0100)
committerRoy Marples <roy@marples.name>
Mon, 27 Mar 2017 15:42:48 +0000 (16:42 +0100)
arp.c

diff --git a/arp.c b/arp.c
index 9943a2121c6e14a4b9079b1cb29da7b3dbb32b4d..bf1f4974a2f2fd0307259e6842116ad0c7a0b3b6 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -204,6 +204,9 @@ arp_read(void *arg)
                        return;
                }
                arp_packet(ifp, buf, (size_t)bytes);
+               /* Check we still have a state after processing. */
+               if ((state = ARP_CSTATE(ifp)) == NULL || state->fd == -1)
+                       break;
        }
 }