]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: net: Correct name copy in eth_raw_bus_post_bind()
authorSimon Glass <sjg@chromium.org>
Sat, 24 Nov 2018 04:29:27 +0000 (21:29 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 5 Dec 2018 13:01:34 +0000 (06:01 -0700)
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>
drivers/net/sandbox-raw-bus.c

index 76d65afe6c87a8215de48f3468dd6677c84bca68..0086f25fc1fa8c8cf8354d41b9aaec2819fb07d9 100644 (file)
@@ -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;
                }