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: Xu Panda <xu.panda@zte.com.cn> Signed-off-by: Yang Yang <yang.yang29@zte.com> Message-Id: <202212051936400309332@zte.com.cn> Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
parent
b8fadb3964
commit
c6f613e5f3
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue