mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 20:56:12 +02:00
board/BuR/common: use strlcpy instead of strncpy
Now strlcpy is used to copy the defip string to the corresponding environment variable. This preserves memory for the NULL termination. Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Link: https://lore.kernel.org/r/20250404072819.69642-2-bernhard.messerklinger@br-automation.com Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
672d081196
commit
970152e4d1
@ -68,7 +68,7 @@ int brdefaultip_setup(int bus, int chip)
|
||||
"if test -r ${ipaddr}; then; else setenv ipaddr 192.168.60.%d; setenv serverip 192.168.60.254; setenv gatewayip 192.168.60.254; setenv netmask 255.255.255.0; fi;",
|
||||
u8buf);
|
||||
else
|
||||
strncpy(defip,
|
||||
strlcpy(defip,
|
||||
"if test -r ${ipaddr}; then; else setenv ipaddr 192.168.60.1; setenv serverip 192.168.60.254; setenv gatewayip 192.168.60.254; setenv netmask 255.255.255.0; fi;",
|
||||
sizeof(defip));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user