1
0
Fork 0

driver/qe: use strncpy instead of strcpy

strncpy is safer than strcpy, use it to instead of strcpy.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
utp
Zhao Qiang 2015-05-05 15:53:33 +08:00 committed by York Sun
parent e94a8fd363
commit 0e0224ee62
1 changed files with 1 additions and 1 deletions

View File

@ -435,7 +435,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, (char *)firmware->id);
strncpy(qe_firmware_info.id, (char *)firmware->id, 62);
qe_firmware_info.extended_modes = firmware->extended_modes;
memcpy(qe_firmware_info.vtraps, firmware->vtraps,
sizeof(firmware->vtraps));