Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef10167c authored by Krishnankutty Kolathappilly's avatar Krishnankutty Kolathappilly Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: fix bound check of offset to avoid overread overwrite



fix bound check of hw_cmd_p->offset in msm_jpeg_hw_exec_cmds
to avoid overread overwrite.

CRs-Fixed: 1088824

Change-Id: Ifaa4b5387d4285ddce16d8e745aa0500c64c568b
Signed-off-by: default avatarKrishnankutty Kolathappilly <kkolatha@codeaurora.org>
parent 1446cd5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -847,7 +847,7 @@ int msm_jpeg_hw_exec_cmds(struct msm_jpeg_hw_cmd *hw_cmd_p, uint32_t m_cmds,
	uint32_t data;

	while (m_cmds--) {
		if (hw_cmd_p->offset > max_size) {
		if (hw_cmd_p->offset >= max_size) {
			JPEG_PR_ERR("%s:%d] %d exceed hw region %d\n", __func__,
				__LINE__, hw_cmd_p->offset, max_size);
			return -EFAULT;