Commit c6f613e5 authored by yang.yang29@zte.com.cn's avatar yang.yang29@zte.com.cn Committed by Corey Minyard
Browse files

ipmi/watchdog: use strscpy() to instead of strncpy()



Xu Panda <xu.panda@zte.com.cn>

The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.

Signed-off-by: default avatarXu Panda <xu.panda@zte.com.cn>
Signed-off-by: default avatarYang Yang <yang.yang29@zte.com>
Message-Id: <202212051936400309332@zte.com.cn>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent b8fadb39
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -213,8 +213,7 @@ static int set_param_str(const char *val, const struct kernel_param *kp)
	char       valcp[16];
	char       *s;

	strncpy(valcp, val, 15);
	valcp[15] = '\0';
	strscpy(valcp, val, 16);

	s = strstrip(valcp);