Skip to contentSkip to conversation

gspca pac7302/pac7311: fix buffer overrun

PATCH In review Németh Márton 2 participants 2 messages Nov 4, 2009 – Nov 5, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gspca pac7302/pac7311: fix buffer overrun

From: Márton Németh <[email protected]>

The reg_w_seq() function expects the sequence length in entries and not in bytes. One entry in init_7302 and init_7311 is two bytes and not one.

---

drivers/media/video/gspca/pac7302.c +1 -1
diff -upr a/drivers/media/video/gspca/pac7302.c b/drivers/media/video/gspca/pac7302.c
@@ -592,7 +592,7 @@ static void sethvflip(struct gspca_dev *
 /* this function is called at probe and resume time for pac7302 */
 static int sd_init(struct gspca_dev *gspca_dev)
 {
-	reg_w_seq(gspca_dev, init_7302, sizeof init_7302);
+	reg_w_seq(gspca_dev, init_7302, sizeof(init_7302)/2);
 
 	return 0;
 }
drivers/media/video/gspca/pac7311.c +1 -1
diff -upr a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
@@ -490,7 +490,7 @@ static void sethvflip(struct gspca_dev *
 /* this function is called at probe and resume time for pac7311 */
 static int sd_init(struct gspca_dev *gspca_dev)
 {
-	reg_w_seq(gspca_dev, init_7311, sizeof init_7311);
+	reg_w_seq(gspca_dev, init_7311, sizeof(init_7311)/2);
 
 	return 0;
 }
#1 lore raw
Quoted 8 lines · On Wed, 04 Nov 2009 23:38:42 +0100 Németh Márton <[email protected]> wrote:

The reg_w_seq() function expects the sequence length in entries and not in bytes. One entry in init_7302 and init_7311 is two bytes and not one.

---
diff -upr a/drivers/media/video/gspca/pac7302.c
b/drivers/media/video/gspca/pac7302.c

	[snip]

Hello Németh,

Thank you for the patch! The bug did exist for a long time, and nobody found it yet.

I have just a remark: some of your patches have a diff starting with 'a/drivers/..'. They should start with 'a/linux/drivers/..' (as done by 'hg export').

Best regards.

Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/