]> git.baikalelectronics.ru Git - uboot.git/commit
net: don't memcpy to NULL
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 7 Dec 2022 10:53:29 +0000 (11:53 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 22 Dec 2022 20:39:13 +0000 (15:39 -0500)
commit89382a315161bbe3c149de205d03ab4f615ff6d1
treea04b35c1e6454c7aa96a46083923ddd39a31d5b3
parent4852c7062e0860a0ff33db851d24690a762dee7c
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: 9ebb1c50b8ba ("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>
net/ndisc.c