summaryrefslogtreecommitdiff
path: root/arch/sparc/kernel/setup_64.c
diff options
context:
space:
mode:
authorZhao Hongjiang <zhaohongjiang@huawei.com>2013-06-09 08:57:58 (GMT)
committerDavid S. Miller <davem@davemloft.net>2013-06-19 09:10:29 (GMT)
commit117a0c5fc9c2d06045bd217385b2b39ea426b5a6 (patch)
tree5023fb469da9fc796e80a1fdb919a2cad0d4cedb /arch/sparc/kernel/setup_64.c
parent242ece22f0bd90e237365e51c5bd90a21693d6c3 (diff)
downloadlinux-117a0c5fc9c2d06045bd217385b2b39ea426b5a6.tar.xz
sparc: kernel: using strlcpy() instead of strcpy()
'boot_command_line' and 'full_boot_str' has a fix length, 'cmdline_p' and 'boot_command' maybe larger than them. So use strlcpy() instead of strcpy() to avoid memory overflow. Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/setup_64.c')
-rw-r--r--arch/sparc/kernel/setup_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 88a127b..1378554 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -555,7 +555,7 @@ void __init setup_arch(char **cmdline_p)
{
/* Initialize PROM console and command line. */
*cmdline_p = prom_getbootargs();
- strcpy(boot_command_line, *cmdline_p);
+ strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
parse_early_param();
boot_flags_init(*cmdline_p);