diff options
author | Simon Glass <sjg@chromium.org> | 2018-11-23 21:29:27 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-12-05 06:01:34 -0700 |
commit | e628bba785a310e80193f9a34c0b53fcb2136c46 (patch) | |
tree | b843193e32b2fe10ba04972d723ebdf5c432d1fd /drivers/net | |
parent | e3491fb11f54e642925f587ed2dd6c98aea9c65d (diff) | |
download | u-boot-e628bba785a310e80193f9a34c0b53fcb2136c46.tar.gz u-boot-e628bba785a310e80193f9a34c0b53fcb2136c46.tar.xz u-boot-e628bba785a310e80193f9a34c0b53fcb2136c46.zip |
sandbox: net: Correct name copy in eth_raw_bus_post_bind()
We cannot be sure that the interface name takes up the full length of the
space available to it. Use strcpy() instead of memcpy() in this case. This
corrects a valgrind warning.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sandbox-raw-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/sandbox-raw-bus.c b/drivers/net/sandbox-raw-bus.c index 76d65afe6c..0086f25fc1 100644 --- a/drivers/net/sandbox-raw-bus.c +++ b/drivers/net/sandbox-raw-bus.c @@ -42,7 +42,7 @@ static int eth_raw_bus_post_bind(struct udevice *dev) device_probe(child); priv = dev_get_priv(child); if (priv) { - memcpy(priv->host_ifname, i->if_name, IFNAMSIZ); + strcpy(priv->host_ifname, i->if_name); priv->host_ifindex = i->if_index; priv->local = local; } |