summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-07-26 23:26:51 +0200
committerScott Wood <scottwood@freescale.com>2015-01-29 23:32:13 -0600
commit5db431285d832156852d6f0013089b5d2305a28d (patch)
treec317ad2e15aeeba0e64b52ecbeddf8f2fcf541b0 /arch/powerpc
parent8ac6e995ac17f33a5cc6796c5069488eb9f4abd7 (diff)
downloadlinux-5db431285d832156852d6f0013089b5d2305a28d.tar.gz
linux-5db431285d832156852d6f0013089b5d2305a28d.tar.bz2
linux-5db431285d832156852d6f0013089b5d2305a28d.zip
powerpc/qe: Use strlcpy()
Replace strcpy and strncpy with strlcpy to avoid strings that are too big, or lack null termination. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> [scottwood@freescale.com: cleaned up commit message] Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1f29cee8da7b..c2518cdb7ddb 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -497,7 +497,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
* saved microcode information and put in the new.
*/
memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
- strcpy(qe_firmware_info.id, firmware->id);
+ strlcpy(qe_firmware_info.id, firmware->id, sizeof(qe_firmware_info.id));
qe_firmware_info.extended_modes = firmware->extended_modes;
memcpy(qe_firmware_info.vtraps, firmware->vtraps,
sizeof(firmware->vtraps));
@@ -583,8 +583,8 @@ struct qe_firmware_info *qe_get_firmware_info(void)
/* Copy the data into qe_firmware_info*/
sprop = of_get_property(fw, "id", NULL);
if (sprop)
- strncpy(qe_firmware_info.id, sprop,
- sizeof(qe_firmware_info.id) - 1);
+ strlcpy(qe_firmware_info.id, sprop,
+ sizeof(qe_firmware_info.id));
prop = of_find_property(fw, "extended-modes", NULL);
if (prop && (prop->length == sizeof(u64))) {