[PATCH] net: lwip: fix dhcp_loop()
Jerome Forissier
jerome.forissier at linaro.org
Fri Nov 22 13:35:29 CET 2024
The local variables ipstr, maskstr and gwstr in static function
dhcp_loop() cannot be pointers to read-only data, since they may be
written to in case the device index is > 0. Therefore make them char
arrays allocated on the stack.
Reported-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
---
net/lwip/dhcp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index 23b56226921..bfc72ca6c57 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -27,9 +27,9 @@ static void call_lwip_dhcp_fine_tmr(void *ctx)
static int dhcp_loop(struct udevice *udev)
{
- char *ipstr = "ipaddr\0\0";
- char *maskstr = "netmask\0\0";
- char *gwstr = "gatewayip\0\0";
+ char ipstr[] = "ipaddr\0\0";
+ char maskstr[] = "netmask\0\0";
+ char gwstr[] = "gatewayip\0\0";
unsigned long start;
struct netif *netif;
struct dhcp *dhcp;
--
2.43.0
More information about the U-Boot
mailing list