aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-10-25 14:38:03 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-10-25 14:38:03 +0000
commit8d27d23671448a7fde5f43b79e5f5ac08ac8c40d (patch)
tree987964aa3c0eb44f616c116f7e1f39806ca7600e
parente837bd8d024753f126e57bf72f4e368a52e5dd01 (diff)
downloadsrc-8d27d23671448a7fde5f43b79e5f5ac08ac8c40d.tar.gz
src-8d27d23671448a7fde5f43b79e5f5ac08ac8c40d.zip
MFC r339581:
Fix off-by-one which can lead to panics. Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/stable/8/; revision=339718
-rw-r--r--sys/dev/sound/midi/sequencer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c
index 1ef784599e4e..abfb662fc931 100644
--- a/sys/dev/sound/midi/sequencer.c
+++ b/sys/dev/sound/midi/sequencer.c
@@ -737,7 +737,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];