From: Roy Marples Date: Tue, 23 Jul 2019 15:11:18 +0000 (+0100) Subject: Linux: Mark another coverity false positive. X-Git-Tag: v8.0.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eed93fbfaa13dfecf4335a6a102aff300b9e97e9;p=thirdparty%2Fdhcpcd.git Linux: Mark another coverity false positive. --- diff --git a/src/if-linux.c b/src/if-linux.c index e3a79473..3919bff5 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -1263,10 +1263,16 @@ if_route(unsigned char cmd, const struct rt *rt) (const char *)(sa) + sa_addroffset((sa)), \ (unsigned short)sa_addrlen((sa))); nlm.rt.rtm_dst_len = (unsigned char)sa_toprefix(&rt->rt_netmask); + /* rt->rt_dest and rt->gateway are unions where sockaddr_in6 + * is the biggest member. However, we access them as the + * generic sockaddr and coverity thinks this will overrun. */ + /* coverity[overrun-buffer-arg] */ ADDSA(RTA_DST, &rt->rt_dest); if (cmd == RTM_ADD || cmd == RTM_CHANGE) { - if (!gateway_unspec) + if (!gateway_unspec) { + /* coverity[overrun-buffer-arg] */ ADDSA(RTA_GATEWAY, &rt->rt_gateway); + } /* Cannot add tentative source addresses. * We don't know this here, so just skip INET6 ifa's.*/ if (!sa_is_unspecified(&rt->rt_ifa) &&