]> 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 14:56:34 +0000 (15:56 +0100)
src/arp.c

index 9db5387f03bc2d85bbcf89410a52a4f89064a26b..fc1223e1a547a36a041ff82b1a1832349c6e34e8 100644 (file)
--- a/src/arp.c
+++ b/src/arp.c
@@ -207,6 +207,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;
        }
 }