From 1d8b6a6843bd0fd4298b6a46f107230bcba52b6d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 16 Dec 2013 20:32:13 +0100 Subject: FULLPIPE: Fix off-by-one error when checking valid 'idx' Verified by sev, but I haven't actually seen it cause any problems. --- engines/fullpipe/messages.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/fullpipe/messages.cpp') diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index d145a11531..e8fcf75fb6 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -331,7 +331,7 @@ void MessageQueue::addExCommandToEnd(ExCommand *ex) { } ExCommand *MessageQueue::getExCommandByIndex(uint idx) { - if (idx > getCount()) + if (idx >= getCount()) return 0; Common::List::iterator it = _exCommands.begin(); @@ -345,7 +345,7 @@ ExCommand *MessageQueue::getExCommandByIndex(uint idx) { } void MessageQueue::deleteExCommandByIndex(uint idx, bool doFree) { - if (idx > getCount()) + if (idx >= getCount()) return; Common::List::iterator it = _exCommands.begin(); -- cgit v1.2.3