From: Felix Fietkau Date: Thu, 29 Oct 2015 14:25:03 +0000 (+0100) Subject: main: fix ip address copy length in send_arp_request X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=83dba5d525a3b7c2ae4fcb24961143bfcfc93ba7;p=oweals%2Frelayd.git main: fix ip address copy length in send_arp_request Detected by Coverity CID 1331153, 1331152, 1331125 Signed-off-by: Felix Fietkau --- diff --git a/main.c b/main.c index 7f33d90..bd330ee 100644 --- a/main.c +++ b/main.c @@ -165,7 +165,7 @@ static void send_arp_request(struct relayd_interface *rif, const uint8_t *ipaddr fill_arp_packet(&pkt, rif, rif->src_ip, ipaddr); pkt.arp.arp_op = htons(ARPOP_REQUEST); - memcpy(pkt.arp.arp_spa, rif->src_ip, ETH_ALEN); + memcpy(pkt.arp.arp_spa, rif->src_ip, sizeof(pkt.arp.arp_spa)); memset(pkt.arp.arp_tha, 0, ETH_ALEN); memset(pkt.eth.ether_dhost, 0xff, ETH_ALEN);