Commit adb4b83c authored by Dan Carpenter's avatar Dan Carpenter Committed by Jason Wessel

kgdboc,kgdbts: strlen() doesn't count the terminator

This is an off by one because strlen() doesn't count the null
terminator.  We strcpy() these strings into an array of size
MAX_CONFIG_LEN.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
parent 521cb40b
...@@ -988,7 +988,7 @@ static void kgdbts_run_tests(void) ...@@ -988,7 +988,7 @@ static void kgdbts_run_tests(void)
static int kgdbts_option_setup(char *opt) static int kgdbts_option_setup(char *opt)
{ {
if (strlen(opt) > MAX_CONFIG_LEN) { if (strlen(opt) >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdbts: config string too long\n"); printk(KERN_ERR "kgdbts: config string too long\n");
return -ENOSPC; return -ENOSPC;
} }
......
...@@ -131,7 +131,7 @@ static void kgdboc_unregister_kbd(void) ...@@ -131,7 +131,7 @@ static void kgdboc_unregister_kbd(void)
static int kgdboc_option_setup(char *opt) static int kgdboc_option_setup(char *opt)
{ {
if (strlen(opt) > MAX_CONFIG_LEN) { if (strlen(opt) >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdboc: config string too long\n"); printk(KERN_ERR "kgdboc: config string too long\n");
return -ENOSPC; return -ENOSPC;
} }
......
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