From: Roy Marples Date: Sat, 22 Feb 2020 17:07:38 +0000 (+0000) Subject: DHCP: Appease LGTM finding unlikely user overflow from overself X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f5d481fabd4da33310ebcb8b02534da77678843;p=thirdparty%2Fdhcpcd.git DHCP: Appease LGTM finding unlikely user overflow from overself Only in privsep. --- diff --git a/src/dhcp.c b/src/dhcp.c index 4015c65f..0c96ea93 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -3556,6 +3556,15 @@ dhcp_recvmsg(struct dhcpcd_ctx *ctx, struct msghdr *msg) struct interface *ifp; const struct dhcp_state *state; +#ifdef PRIVSEP + /* Unlikely, but appeases sanitizers. */ + if (iov->iov_len > FRAMELEN_MAX) { + errno = ENOBUFS; + logerr(__func__); + return; + } +#endif + ifp = if_findifpfromcmsg(ctx, msg, NULL); if (ifp == NULL) { logerr(__func__);