Skip to content

Commit

Permalink
LF-2474: media: samsung csi: fix string overflow issue
Browse files Browse the repository at this point in the history
Coverity Issue: 10436670, 10893372, 10436673, fix string overflow issue.
The length of v4l2_capability structure driver member is 16, but the length
of "csi_samsung_subdev" is 18, when assign it to driver member, it will
occur string overflow issue.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit b4ffa85521e12cf02fb22e955331c0b1355ee219)
  • Loading branch information
Guoniu.zhou authored and Robby Cai committed Mar 5, 2021
1 parent 21c3114 commit 0ff86d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/imx/imx8-mipi-csi2-sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ static int csis_ioc_qcap(struct v4l2_subdev *dev, void *args)
{
struct csi_state *state = mipi_sd_to_csi_state(dev);
struct v4l2_capability *cap = (struct v4l2_capability *)args;
strcpy((char *)cap->driver, "csi_samsung_subdev");
strcpy((char *)cap->driver, "csi_sam_subdev");
cap->bus_info[0] = state->index;
return 0;
}
Expand Down

0 comments on commit 0ff86d2

Please sign in to comment.