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.messerklin...@br-automation.com>
---

(no changes since v1)

 board/BuR/common/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
 
-- 
2.49.0

Reply via email to