LF-2474: media: samsung csi: fix string overflow issue

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)
(cherry picked from commit 0ff86d26f925534530f0d741c54f9ddfdeadd10b)
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
This commit is contained in:
Guoniu.zhou 2020-11-16 14:36:06 +08:00 committed by Andrey Zhizhikin
parent ff039ffe02
commit 15f452a56f
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}