Message ID | 1515412892-18741-1-git-send-email-wangxiongfeng2@huawei.com |
---|---|
State | New |
Headers | show |
Series | ipmi: use correct string length | expand |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index f45732a..01fbffb 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); diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 76b2706..6004851 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -232,7 +232,7 @@ static int set_param_str(const char *val, const struct kernel_param *kp) char valcp[16]; char *s; - strncpy(valcp, val, 16); + strncpy(valcp, val, 15); valcp[15] = '\0'; s = strstrip(valcp);