diff options
| author | Bernhard Messerklinger <[email protected]> | 2025-04-04 09:27:57 +0200 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2025-04-16 15:39:48 +0200 |
| commit | 970152e4d1d0a839bf004e701ced597e8fc23237 (patch) | |
| tree | dc5b58002a51c8489fdf33bf0f8379a5699ca735 | |
| parent | 672d081196b92745799149714d4cd7f58d9fd356 (diff) | |
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
| -rw-r--r-- | board/BuR/common/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 7fb61736710..3513f43a9f5 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -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)); |
