msm: vidc: Fix buffer overflow issue in driver

This change fixes a buffer overflow issue during
venus version write to a local buffer.

CRs-Fixed: 944588

Change-Id: Id97f89debbd8d160a8ef624ae0c1be16c47d3270
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
This commit is contained in:
Arun Menon 2016-01-27 13:01:58 -08:00 committed by Gerrit - the friendly Code Review server
parent 400520a6e2
commit 9c926ce7aa

View file

@ -4399,7 +4399,7 @@ static int venus_hfi_get_fw_info(void *dev, struct hal_fw_info *fw_info)
goto fail_version_string;
}
for (i--; i < VENUS_VERSION_LENGTH && j < VENUS_VERSION_LENGTH; i++)
for (i--; i < VENUS_VERSION_LENGTH && j < VENUS_VERSION_LENGTH - 1; i++)
fw_info->version[j++] = version[i];
fw_info->version[j] = '\0';