From 252e2a84a250faa99dbacae6c439ac132b8ca9e7 Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 2 Jan 2019 11:24:32 +0100 Subject: [PATCH] Fix another potential Buffer overrun in sqWin32MIDI.c The joy of 0-based indices... [skip travis] --- platforms/win32/plugins/MIDIPlugin/sqWin32MIDI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/win32/plugins/MIDIPlugin/sqWin32MIDI.c b/platforms/win32/plugins/MIDIPlugin/sqWin32MIDI.c index 0366d070e9..3bceb4e7d2 100644 --- a/platforms/win32/plugins/MIDIPlugin/sqWin32MIDI.c +++ b/platforms/win32/plugins/MIDIPlugin/sqWin32MIDI.c @@ -605,7 +605,7 @@ int finishSysExCommand(sqMidiPort *port, char *bufferPtr, int count) /* Return the port with the given number or NULL */ static sqMidiPort* GetPort(int portNum) { - if(portNum > MAX_DEVICES || portNum < 0) + if(portNum >= MAX_DEVICES || portNum < 0) { success(false); return NULL;