linux/drivers/staging
Dan Carpenter 423350af9e media: av7110: prevent underflow in write_ts_to_decoder()
[ Upstream commit eed9496a05 ]

The buf[4] value comes from the user via ts_play().  It is a value in
the u8 range.  The final length we pass to av7110_ipack_instant_repack()
is "len - (buf[4] + 1) - 4" so add a check to ensure that the length is
not negative.  It's not clear that passing a negative len value does
anything bad necessarily, but it's not best practice.

With the new bounds checking the "if (!len)" condition is no longer
possible or required so remove that.

Fixes: fd46d16d60 ("V4L/DVB (11759): dvb-ttpci: Add TS replay capability")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:03:10 +09:00
..
axis-fifo
board
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-03-11 13:55:34 +01:00
fbtft
fieldbus
gdm724x
greybus
iio staging: iio: resolver: ads1210: fix config mode 2023-05-11 23:03:01 +09:00
ks7010
media media: av7110: prevent underflow in write_ts_to_decoder() 2023-05-11 23:03:10 +09:00
most
nvec
octeon
olpc_dcon
pi433 staging: pi433: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:36 +01:00
qlge
r8188eu
rtl8192e staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh 2023-03-13 10:21:31 +01:00
rtl8192u
rtl8712
rtl8723bs staging: rtl8723bs: Pass correct parameters to cfg80211_get_bss() 2023-03-17 08:50:16 +01:00
rts5208
sm750fb
vc04_services
vme_user
vt6655
vt6656
wlan-ng
Kconfig
Makefile