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

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
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment