aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2011-12-19 17:12:29 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-24 15:46:45 -0500
commitbc757f6f5bf4e9251bbc1a3419c94ffe9fd3e2ee (patch)
tree593f673d80d7cf6981b346dc5d5ac2e6ba5d5c9a /lib
parent74df138d508eb35e8b929e165e5403cfbb46a0c5 (diff)
dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query()
Replace strcpy with strlcpy, and add define for the size constant. [jbaron@redhat.com: Use DDEBUG_STRING_SIZE for overflow check] Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/dynamic_debug.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 8c88b892ebb8..6fc8622f0a83 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -525,14 +525,16 @@ EXPORT_SYMBOL(__dynamic_netdev_dbg);
525 525
526#endif 526#endif
527 527
528static __initdata char ddebug_setup_string[1024]; 528#define DDEBUG_STRING_SIZE 1024
529static __initdata char ddebug_setup_string[DDEBUG_STRING_SIZE];
530
529static __init int ddebug_setup_query(char *str) 531static __init int ddebug_setup_query(char *str)
530{ 532{
531 if (strlen(str) >= 1024) { 533 if (strlen(str) >= DDEBUG_STRING_SIZE) {
532 pr_warn("ddebug boot param string too large\n"); 534 pr_warn("ddebug boot param string too large\n");
533 return 0; 535 return 0;
534 } 536 }
535 strcpy(ddebug_setup_string, str); 537 strlcpy(ddebug_setup_string, str, DDEBUG_STRING_SIZE);
536 return 1; 538 return 1;
537} 539}
538 540