From 83dba5d525a3b7c2ae4fcb24961143bfcfc93ba7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 29 Oct 2015 15:25:03 +0100 Subject: [PATCH] main: fix ip address copy length in send_arp_request Detected by Coverity CID 1331153, 1331152, 1331125 Signed-off-by: Felix Fietkau --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.25.1