From bb415b2a5f46d4579173d75f5451627b9d358ea8 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Mon, 22 Oct 2018 08:55:58 +0000 Subject: Fix off-by-one which can lead to panics. Found by: Peter Holm MFC after: 3 days Sponsored by: Mellanox Technologies --- sys/dev/sound/midi/sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/sound/midi') diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 32ba8c881bda..65db6d5cd7cf 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -730,7 +730,7 @@ static int seq_fetch_mid(struct seq_softc *scp, int unit, kobj_t *md) { - if (unit > scp->midi_number || unit < 0) + if (unit >= scp->midi_number || unit < 0) return EINVAL; *md = scp->midis[unit]; -- cgit v1.3