[Scummvm-cvs-logs] scummvm master -> ae8ab8d94e53ce94330987705da2353f7e146ba5

lordhoto lordhoto at gmail.com
Wed Dec 28 01:41:34 CET 2011


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:
ae8ab8d94e KYRA: Silence some valgrind warnings by doing a slight sanity check on savefile size.


Commit: ae8ab8d94e53ce94330987705da2353f7e146ba5
    https://github.com/scummvm/scummvm/commit/ae8ab8d94e53ce94330987705da2353f7e146ba5
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-27T16:40:29-08:00

Commit Message:
KYRA: Silence some valgrind warnings by doing a slight sanity check on savefile size.

Changed paths:
    engines/kyra/saveload.cpp



diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index f4fd466..41ba1e5 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -60,6 +60,9 @@ KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::Seekab
 		bool saveOk = false;
 
 		for (uint i = 0; i < ARRAYSIZE(descriptionSize) && !saveOk; ++i) {
+			if (in->size() < descriptionSize[i] + 6)
+				continue;
+
 			in->seek(0, SEEK_SET);
 			in->read(descriptionBuffer, descriptionSize[i]);
 			descriptionBuffer[descriptionSize[i]] = 0;






More information about the Scummvm-git-logs mailing list