From c6a543e59b3b5d77d0b1aa9cd2a0480e81ad33be Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Fri, 17 Jun 2011 21:16:38 -0300 Subject: [PATCH] --- yaml --- r: 261547 b: refs/heads/master c: 709d92083af0b0529f6e1d11d17718c9a1da8f01 h: refs/heads/master i: 261545: 185e052f73067809504280a1317e3c9b6ae2c637 261543: 3c934063c7174544c225616e87a4358dae47c91b v: v3 --- [refs] | 2 +- trunk/drivers/media/dvb/dvb-usb/af9015.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8c2eb558ee88..dfccaa054048 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 16b2dc2a8b44ec796791af9f69cce22f7cde0410 +refs/heads/master: 709d92083af0b0529f6e1d11d17718c9a1da8f01 diff --git a/trunk/drivers/media/dvb/dvb-usb/af9015.c b/trunk/drivers/media/dvb/dvb-usb/af9015.c index 0bfe83b63e01..41a7c430f9c1 100644 --- a/trunk/drivers/media/dvb/dvb-usb/af9015.c +++ b/trunk/drivers/media/dvb/dvb-usb/af9015.c @@ -292,6 +292,10 @@ Due to that the only way to select correct tuner is use demodulator I2C-gate. } if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { + if (msg[i].len > 3 || msg[i+1].len > 61) { + ret = -EOPNOTSUPP; + goto error; + } if (msg[i].addr == af9015_af9013_config[0].demod_address) req.cmd = READ_MEMORY; @@ -306,6 +310,10 @@ Due to that the only way to select correct tuner is use demodulator I2C-gate. ret = af9015_ctrl_msg(d, &req); i += 2; } else if (msg[i].flags & I2C_M_RD) { + if (msg[i].len > 61) { + ret = -EOPNOTSUPP; + goto error; + } if (msg[i].addr == af9015_af9013_config[0].demod_address) { ret = -EINVAL; @@ -321,6 +329,10 @@ Due to that the only way to select correct tuner is use demodulator I2C-gate. ret = af9015_ctrl_msg(d, &req); i += 1; } else { + if (msg[i].len > 21) { + ret = -EOPNOTSUPP; + goto error; + } if (msg[i].addr == af9015_af9013_config[0].demod_address) req.cmd = WRITE_MEMORY;