summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-03-27 15:56:34 +0100
committerRoy Marples <roy@marples.name>2017-03-27 16:42:48 +0100
commita017eae146151a5ffeefe23757a1bc703ddbfdcc (patch)
tree86e9dcfc890cbb7345d26af302947e92972364da
parent48ad96637f167fc61bc43787bad5e765a2f22642 (diff)
downloaddhcpcd-a017eae146151a5ffeefe23757a1bc703ddbfdcc.tar.xz
Fix a potential crash where the ARP state could be freed during processing.
-rw-r--r--arp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arp.c b/arp.c
index 9943a212..bf1f4974 100644
--- 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;
}
}