summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250/8250_early.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-01-20 13:36:02 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-21 03:50:36 +0400
commitf8a2b220afef7699f7a90d97dbc2d8830979874e (patch)
tree65aa9a84d8ee0babccf6aa9934ca5a9a75261d6d /drivers/tty/serial/8250/8250_early.c
parent4f73bc4dd3e8563ef4109f293a092820dff66d92 (diff)
downloadlinux-f8a2b220afef7699f7a90d97dbc2d8830979874e.tar.xz
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>
Diffstat (limited to 'drivers/tty/serial/8250/8250_early.c')
-rw-r--r--drivers/tty/serial/8250/8250_early.c2
1 files changed, 1 insertions, 1 deletions
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",