git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70a4d1f
)
sandbox: eth-raw: Prevent possible buffer overflow
author
Andrew Goodbody
<andrew.goodbody@linaro.org>
Thu, 17 Jul 2025 11:09:15 +0000
(12:09 +0100)
committer
Tom Rini
<trini@konsulko.com>
Thu, 24 Jul 2025 19:30:20 +0000
(13:30 -0600)
Instead of strcpy which is unbounded use strlcpy to ensure that the
receiving buffer cannot be overflowed.
This issue found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/sandbox-raw-bus.c
patch
|
blob
|
history
diff --git
a/drivers/net/sandbox-raw-bus.c
b/drivers/net/sandbox-raw-bus.c
index
15670d6
..
c698a07
100644
(file)
--- 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) {
- str
cpy(priv->host_ifname, i->if_name
);
+ str
lcpy(priv->host_ifname, i->if_name, IFNAMSIZ
);
priv->host_ifindex = i->if_index;
priv->local = local;
}