netlink: fix incorrect sizeof argument
authorHans Dedecker <dedeckeh@gmail.com>
Sat, 26 May 2018 11:30:47 +0000 (13:30 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 26 May 2018 11:32:02 +0000 (13:32 +0200)
Fix incorrect sizeof arguments detetced by Coverity in CID 1430866 and
CID 1430893

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/netlink.c

index e9fd04a17dc98863e0ecb84835b4c37033351f6c..56d35df86a222839dfc23efa65d709c338e09c2b 100644 (file)
@@ -234,14 +234,14 @@ static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg)
                event_info.rt.dst_len = rtm->rtm_dst_len;
                if (nla[RTA_DST])
                        nla_memcpy(&event_info.rt.dst, nla[RTA_DST],
-                                       sizeof(&event_info.rt.dst));
+                                       sizeof(event_info.rt.dst));
 
                if (nla[RTA_OIF])
                        event_info.iface = odhcpd_get_interface_by_index(nla_get_u32(nla[RTA_OIF]));
 
                if (nla[RTA_GATEWAY])
                        nla_memcpy(&event_info.rt.gateway, nla[RTA_GATEWAY],
-                                       sizeof(&event_info.rt.gateway));
+                                       sizeof(event_info.rt.gateway));
 
                call_netevent_handler_list(add ? NETEV_ROUTE6_ADD : NETEV_ROUTE6_DEL,
                                        &event_info);