diff options
| author | Jim Cromie <[email protected]> | 2011-12-19 22:12:29 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2012-01-24 20:46:45 +0000 |
| commit | bc757f6f5bf4e9251bbc1a3419c94ffe9fd3e2ee (patch) | |
| tree | 593f673d80d7cf6981b346dc5d5ac2e6ba5d5c9a /lib/dynamic_debug.c | |
| parent | dynamic_debug: change verbosity at runtime (diff) | |
| download | kernel-bc757f6f5bf4e9251bbc1a3419c94ffe9fd3e2ee.tar.gz kernel-bc757f6f5bf4e9251bbc1a3419c94ffe9fd3e2ee.zip | |
dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query()
Replace strcpy with strlcpy, and add define for the size constant.
[[email protected]: Use DDEBUG_STRING_SIZE for overflow check]
Signed-off-by: Jim Cromie <[email protected]>
Signed-off-by: Jason Baron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/dynamic_debug.c')
| -rw-r--r-- | lib/dynamic_debug.c | 8 |
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); #endif -static __initdata char ddebug_setup_string[1024]; +#define DDEBUG_STRING_SIZE 1024 +static __initdata char ddebug_setup_string[DDEBUG_STRING_SIZE]; + static __init int ddebug_setup_query(char *str) { - if (strlen(str) >= 1024) { + if (strlen(str) >= DDEBUG_STRING_SIZE) { pr_warn("ddebug boot param string too large\n"); return 0; } - strcpy(ddebug_setup_string, str); + strlcpy(ddebug_setup_string, str, DDEBUG_STRING_SIZE); return 1; } |
