mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 01:44:34 +00:00
net: lwip: fix get_udev_ipv4_info()
The local variables ipstr, maskstr and gwstr in static function get_udev_ipv4_info() 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@linaro.org> Reported-by: Adriano Cordova <adrianox@gmail.com> Link: https://lists.denx.de/pipermail/u-boot/2024-November/572066.html Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
dfe5f16a33
commit
7d80e7368e
1 changed files with 3 additions and 3 deletions
|
@ -91,9 +91,9 @@ struct netif *net_lwip_get_netif(void)
|
|||
static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
|
||||
ip4_addr_t *mask, ip4_addr_t *gw)
|
||||
{
|
||||
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";
|
||||
int idx = dev_seq(dev);
|
||||
char *env;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue