[Scummvm-cvs-logs] scummvm master -> 1d8b6a6843bd0fd4298b6a46f107230bcba52b6d

eriktorbjorn eriktorbjorn at telia.com
Mon Dec 16 20:33:44 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1d8b6a6843 FULLPIPE: Fix off-by-one error when checking valid 'idx'


Commit: 1d8b6a6843bd0fd4298b6a46f107230bcba52b6d
    https://github.com/scummvm/scummvm/commit/1d8b6a6843bd0fd4298b6a46f107230bcba52b6d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-12-16T11:32:13-08:00

Commit Message:
FULLPIPE: Fix off-by-one error when checking valid 'idx'

Verified by sev, but I haven't actually seen it cause any problems.

Changed paths:
    engines/fullpipe/messages.cpp



diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index d145a11..e8fcf75 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<ExCommand *>::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<ExCommand *>::iterator it = _exCommands.begin();






More information about the Scummvm-git-logs mailing list