mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
media: dw2102: fix a potential buffer overflow
commit 1c73d0b29d04bf4082e7beb6a508895e118ee30d upstream. 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: 0e148a522b84 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 39fb2a0c2e78d9b2de726be119e6d06e38aa4ed4) Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
This commit is contained in:
parent
a64eeaefb3
commit
9c65534445
@ -791,7 +791,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user