mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
net: don't memcpy to NULL
In ndisc_receive() 7 bytes are copied from a buffer of size 6 to NULL.
net_nd_packet_mac is a pointer. If it is NULL, we should set it to the
address of the buffer with the MAC address.
Addresses-Coverity-ID: 430974 ("Out-of-bounds access")
Fixes: c6610e1d90
("net: ipv6: Add Neighbor Discovery Protocol (NDP)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
This commit is contained in:
parent
0d6d5a4aa6
commit
56e3b14703
1 changed files with 1 additions and 1 deletions
|
@ -265,7 +265,7 @@ int ndisc_receive(struct ethernet_hdr *et, struct ip6_hdr *ip6, int len)
|
|||
|
||||
/* save address for later use */
|
||||
if (!net_nd_packet_mac)
|
||||
memcpy(net_nd_packet_mac, neigh_eth_addr, 7);
|
||||
net_nd_packet_mac = neigh_eth_addr;
|
||||
|
||||
/* modify header, and transmit it */
|
||||
memcpy(((struct ethernet_hdr *)net_nd_tx_packet)->et_dest,
|
||||
|
|
Loading…
Reference in a new issue