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

Commit f8a2b220 authored by Chen Gang's avatar Chen Gang Committed by Greg Kroah-Hartman
Browse files

drivers/tty/serial/8250: use strlcpy instead of strcpy



  The fields must be null-terminated, or next printk for %s, will cause issue.

Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f73bc4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -194,7 +194,7 @@ static int __init parse_options(struct early_serial8250_device *device,
		options++;
		options++;
		device->baud = simple_strtoul(options, NULL, 0);
		device->baud = simple_strtoul(options, NULL, 0);
		length = min(strcspn(options, " "), sizeof(device->options));
		length = min(strcspn(options, " "), sizeof(device->options));
		strncpy(device->options, options, length);
		strlcpy(device->options, options, length);
	} else {
	} else {
		device->baud = probe_baud(port);
		device->baud = probe_baud(port);
		snprintf(device->options, sizeof(device->options), "%u",
		snprintf(device->options, sizeof(device->options), "%u",