Skip to content

Commit

Permalink
sound: mpu401.c: Buffer overflow
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Roel Kluin authored and Takashi Iwai committed Jul 29, 2009
1 parent c45ec06 commit a987004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/oss/mpu401.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a987004

Please sign in to comment.