Browse Source

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: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chen Gang 12 years ago
parent
commit
f8a2b220af
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/tty/serial/8250/8250_early.c

+ 1 - 1
drivers/tty/serial/8250/8250_early.c

@@ -194,7 +194,7 @@ static int __init parse_options(struct early_serial8250_device *device,
 		options++;
 		device->baud = simple_strtoul(options, NULL, 0);
 		length = min(strcspn(options, " "), sizeof(device->options));
-		strncpy(device->options, options, length);
+		strlcpy(device->options, options, length);
 	} else {
 		device->baud = probe_baud(port);
 		snprintf(device->options, sizeof(device->options), "%u",