We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7b6fa9 commit 97eaa29Copy full SHA for 97eaa29
net/ipv4/arp.c
@@ -1104,7 +1104,8 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
1104
if (neigh) {
1105
if (!(neigh->nud_state & NUD_NOARP)) {
1106
read_lock_bh(&neigh->lock);
1107
- memcpy(r->arp_ha.sa_data, neigh->ha, dev->addr_len);
+ memcpy(r->arp_ha.sa_data, neigh->ha,
1108
+ min(dev->addr_len, (unsigned char)sizeof(r->arp_ha.sa_data_min)));
1109
r->arp_flags = arp_state_to_flags(neigh);
1110
read_unlock_bh(&neigh->lock);
1111
r->arp_ha.sa_family = dev->type;
0 commit comments