From: Eugene Teo Date: Sat, 25 Mar 2006 11:08:25 +0000 (-0800) Subject: [PATCH] Fix sequencer missing negative bound check X-Git-Tag: v2.6.17-rc1~746 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=37f1e984253c7eeee8e0f2be9d134d1e9e34b9d4;p=linux-2.6-omap-h63xx.git [PATCH] Fix sequencer missing negative bound check 'int dev' came out of an 'unsigned char *' - as such, it will not get a negative value. Thanks Valdis. Signed-off-by: Eugene Teo Cc: Jaroslav Kysela Acked-by: Takashi Iwai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c index 698614226c9..347cd79c250 100644 --- a/sound/oss/sequencer.c +++ b/sound/oss/sequencer.c @@ -709,11 +709,11 @@ static void seq_local_event(unsigned char *event_rec) static void seq_sysex_message(unsigned char *event_rec) { - int dev = event_rec[1]; + unsigned int dev = event_rec[1]; int i, l = 0; unsigned char *buf = &event_rec[2]; - if ((int) dev > max_synthdev) + if (dev > max_synthdev) return; if (!(synth_open_mask & (1 << dev))) return;