Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc757f6f authored by Jim Cromie's avatar Jim Cromie Committed by Greg Kroah-Hartman
Browse files

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: default avatarJim Cromie <jim.cromie@gmail.com>
Signed-off-by: default avatarJason Baron <jbaron@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 74df138d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
}