1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/media/platform/sti/delta
Mauro Carvalho Chehab 54e80d9883 media: sti: don't copy past the size
The logic at delta_ipc_open() tries to copy past the size of
the name passed to it:

	drivers/media/platform/sti/delta/delta-ipc.c:178 delta_ipc_open() error: __memcpy() 'name' too small (17 vs 32)

Basically,this function is called just one with:

	ret = delta_ipc_open(pctx, "JPEG_DECODER_HW0", ...);

The string used there has just 17 bytes. Yet, the logic tries
to copy the entire name size (32 bytes), which is plain wrong.

Replace it by strscpy, which is good enough to copy the string,
warranting that this will be NUL-terminated.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-07-12 09:16:31 +02:00
..
delta-cfg.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-debug.c media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-debug.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-ipc.c media: sti: don't copy past the size 2021-07-12 09:16:31 +02:00
delta-ipc.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mem.c media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mem.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mjpeg-dec.c media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mjpeg-fw.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mjpeg-hdr.c media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-mjpeg.h media: platform: sti: Adopt SPDX identifier 2017-12-13 09:54:41 -05:00
delta-v4l2.c media: st-delta: Remove redundant assignment to ret 2021-06-02 13:33:37 +02:00
delta.h media: platform: fix several typos 2019-03-01 09:35:21 -05:00
Makefile media: sti: fix obj-$(config) targets 2021-05-18 11:32:03 +02:00