diff options
author | Zhao Hongjiang <zhaohongjiang@huawei.com> | 2013-06-09 12:57:58 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-19 13:10:29 +0400 |
commit | 117a0c5fc9c2d06045bd217385b2b39ea426b5a6 (patch) | |
tree | 5023fb469da9fc796e80a1fdb919a2cad0d4cedb /arch/sparc/kernel/ds.c | |
parent | 242ece22f0bd90e237365e51c5bd90a21693d6c3 (diff) | |
download | linux-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/ds.c')
-rw-r--r-- | arch/sparc/kernel/ds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 75bb608c423e..5ef48dab5636 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -843,7 +843,8 @@ void ldom_reboot(const char *boot_command) unsigned long len; strcpy(full_boot_str, "boot "); - strcpy(full_boot_str + strlen("boot "), boot_command); + strlcpy(full_boot_str + strlen("boot "), boot_command, + sizeof(full_boot_str + strlen("boot "))); len = strlen(full_boot_str); if (reboot_data_supported) { |