Commit 0e0224ee authored by Zhao Qiang's avatar Zhao Qiang Committed by York Sun

driver/qe: use strncpy instead of strcpy

strncpy is safer than strcpy, use it to instead of strcpy.
Signed-off-by: default avatarZhao Qiang <B45475@freescale.com>
Reviewed-by: default avatarYork Sun <yorksun@freescale.com>
parent e94a8fd3
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment