V4L/DVB (6559): Fix a buffer overflow at xc2028_get_reg
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 5 Nov 2007 11:41:50 +0000 (08:41 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:02:01 +0000 (19:02 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-xc2028.c

index 80d1402..b4c88ed 100644 (file)
@@ -94,13 +94,13 @@ struct xc2028_data {
 static int xc2028_get_reg(struct xc2028_data *priv, u16 reg)
 {
        int rc;
-       unsigned char buf[1];
+       unsigned char buf[2];
 
        tuner_info("%s called\n", __FUNCTION__);
 
        buf[0] = reg;
 
-       i2c_send(rc, priv, buf, sizeof(buf));
+       i2c_send(rc, priv, buf, 1);
        if (rc < 0)
                return rc;