Skip to contentSkip to conversation

drivers/net/irda/irda-usb.c: fix buffer overflow

PATCH In review [email protected] 2 participants 2 messages Jan 13, 2009 – Jan 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/irda/irda-usb.c: fix buffer overflow

From: Jos-Vicente Gilabert <[email protected]>

Taken from http://bugzilla.kernel.org/show_bug.cgi?id=12397

We're doing an sprintf of an 11-char string into an 11-char buffer. Whoops. It breaks firmware uploading.

---

 drivers/net/irda/irda-usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/irda/irda-usb.c renamed from drivers/net/irda/irda-usb.c~drivers-net-irda-irda-usbc-fix-buffer-overflow +1 -1
diff -puN drivers/net/irda/irda-usb.c~drivers-net-irda-irda-usbc-fix-buffer-overflow drivers/net/irda/irda-usb.c
@@ -1073,7 +1073,7 @@ static int stir421x_patch_device(struct 
 {
 	unsigned int i;
 	int ret;
-	char stir421x_fw_name[11];
+	char stir421x_fw_name[12];
 	const struct firmware *fw;
 	const unsigned char *fw_version_ptr; /* pointer to version string */
 	unsigned long fw_version = 0;

_