mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
media: dw2102: fix a potential buffer overflow
[ Upstream commit1c73d0b29d] As pointed by smatch: drivers/media/usb/dvb-usb/dw2102.c:802 su3000_i2c_transfer() error: __builtin_memcpy() '&state->data[4]' too small (64 vs 67) That seemss to be due to a wrong copy-and-paste. Fixes:0e148a522b("media: dw2102: Don't translate i2c read into write") Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e3117cf24b
commit
dd467e2051
@@ -786,7 +786,7 @@ static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
|
||||
if (msg[j].flags & I2C_M_RD) {
|
||||
/* single read */
|
||||
if (1 + msg[j].len > sizeof(state->data)) {
|
||||
if (4 + msg[j].len > sizeof(state->data)) {
|
||||
warn("i2c rd: len=%d is too big!\n", msg[j].len);
|
||||
num = -EOPNOTSUPP;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user