All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mpu401.c: Buffer overflow
@ 2009-07-29 10:12 Roel Kluin
  2009-07-29 12:44 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-07-29 10:12 UTC (permalink / raw)
  To: tiwai, alsa-devel, Andrew Morton

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>
---
Found with Parfait, http://research.sun.com/projects/parfait/

diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 1b2316f..734b8f9 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-29 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 10:12 [PATCH] mpu401.c: Buffer overflow Roel Kluin
2009-07-29 12:44 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.