From: Chen Gang Date: Sun, 20 Jan 2013 09:36:02 +0000 (+0800) Subject: drivers/tty/serial/8250: use strlcpy instead of strcpy X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f8a2b220afef7699f7a90d97dbc2d8830979874e;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c index f53a7db4350d..721904f8efa9 100644 --- a/drivers/tty/serial/8250/8250_early.c +++ b/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",