From: Roy Marples Date: Wed, 12 Jun 2013 15:21:05 +0000 (+0000) Subject: Ensure we read the full lease. X-Git-Tag: v6.0.0~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ce65558f42ff51b7549c62e8e2a751fa446f1a7;p=thirdparty%2Fdhcpcd.git Ensure we read the full lease. --- diff --git a/dhcp6.c b/dhcp6.c index aa93e4d6..08a51a87 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -1572,6 +1572,10 @@ dhcp6_readlease(struct interface *ifp) return -1; bytes = read(fd, state->new, state->new_len); close(fd); + if (bytes < (ssize_t)state->new_len) { + syslog(LOG_ERR, "%s: read: %m", __func__); + goto ex; + } /* Check to see if the lease is still valid */ fd = dhcp6_validatelease(ifp, state->new, state->new_len, NULL);