Skip to contentSkip to conversation

mpu401.c: Buffer overflow

PATCH In review Roel Kluin 2 participants 2 messages Jul 29, 2009 Sound

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 mpu401.c: Buffer overflow

mpu_synth_info[m].name is a char[30], and the minimum length of the data written by sprintf is 31 bytes including terminating null.

---
Found with Parfait, http://research.sun.com/projects/parfait/

sound/oss/mpu401.c +1 -1
index 1b2316f..734b8f9 100644
@@ -1074,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
 			sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name);
 		else
 			sprintf(mpu_synth_info[m].name,
-				"MPU-401 %d.%d%c Midi interface #%d",
+				"MPU-401 %d.%d%c MIDI #%d",
 				(int) (devc->version & 0xf0) >> 4,
 				devc->version & 0x0f,
 				revision_char,
#1 lore raw

At Wed, 29 Jul 2009 12:12:09 +0200,

Quoted 5 lines · Roel Kluin

mpu_synth_info[m].name is a char[30], and the minimum length of the data written by sprintf is 31 bytes including terminating null.

Applied now. Thanks.

Takashi

Quoted 17 lines

---
Found with Parfait, http://research.sun.com/projects/parfait/

sound/oss/mpu401.c +1 -1
index 1b2316f..734b8f9 100644
@@ -1074,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
 			sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name);
 		else
 			sprintf(mpu_synth_info[m].name,
-				"MPU-401 %d.%d%c Midi interface #%d",
+				"MPU-401 %d.%d%c MIDI #%d",
 				(int) (devc->version & 0xf0) >> 4,
 				devc->version & 0x0f,
 				revision_char,