summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_msghandler.c
diff options
context:
space:
mode:
authorXiongfeng Wang <xiongfeng.wang@linaro.org>2018-01-08 20:01:32 +0800
committerCorey Minyard <cminyard@mvista.com>2018-01-08 20:02:47 -0600
commit1b4254cee0643ae624d33481b5107b790ae581b9 (patch)
tree1140e7da6fb24f876b33173403e3ab4f9d2694fa /drivers/char/ipmi/ipmi_msghandler.c
parent174134ac760275457bb0d1560a0dbe6cf8a12ad6 (diff)
downloadtalos-obmc-linux-1b4254cee0643ae624d33481b5107b790ae581b9.tar.gz
talos-obmc-linux-1b4254cee0643ae624d33481b5107b790ae581b9.zip
ipmi: use correct string length
gcc-8 reports drivers/char/ipmi/ipmi_msghandler.c: In function 'panic_op_write_handler': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 16 equals destination size [-Wstringop-truncation] drivers/char/ipmi/ipmi_watchdog.c: In function 'set_param_str': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 16 equals destination size [-Wstringop-truncation] We need one less byte or call strlcpy() to make it a nul-terminated string. Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index f45732a2cb3e..01fbffb3168e 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -84,7 +84,7 @@ static int panic_op_write_handler(const char *val,
char valcp[16];
char *s;
- strncpy(valcp, val, 16);
+ strncpy(valcp, val, 15);
valcp[15] = '\0';
s = strstrip(valcp);
OpenPOWER on IntegriCloud