]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: fireface: Off by one in latter_handle_midi_msg()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Jan 2019 12:44:18 +0000 (15:44 +0300)
committerTakashi Iwai <tiwai@suse.de>
Fri, 25 Jan 2019 14:51:33 +0000 (15:51 +0100)
The > should be >= or otherwise we potentially read one element beyond
the end of the ff->tx_midi_substreams[] array.

Fixes: 73f5537fb209 ("ALSA: fireface: support tx MIDI functionality of Fireface UCX")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/fireface/ff-protocol-latter.c

index 0fbc1950327f866d60245cf48debcae6ba328e01..c8236ff89b7fb9decdc867770f8ce7f694e3f9dd 100644 (file)
@@ -293,7 +293,7 @@ static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
        struct snd_rawmidi_substream *substream;
        unsigned int len;
 
-       if (index > ff->spec->midi_in_ports)
+       if (index >= ff->spec->midi_in_ports)
                return;
 
        switch (data & 0x0000000f) {