[Scummvm-git-logs] scummvm master -> 6accd633b8f98f419ec02233d3dce5acc080a014
bluegr
bluegr at gmail.com
Sat Sep 14 19:54:17 CEST 2019
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:
6accd633b8 SCI: Add a sanity check when loading vocab 901 (suffixes)
Commit: 6accd633b8f98f419ec02233d3dce5acc080a014
https://github.com/scummvm/scummvm/commit/6accd633b8f98f419ec02233d3dce5acc080a014
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2019-09-14T20:53:10+03:00
Commit Message:
SCI: Add a sanity check when loading vocab 901 (suffixes)
An invalid access error, uncovered by the Span mechanism. Fixes the
QFG2 demo (bug #11147)
Changed paths:
engines/sci/parser/vocabulary.cpp
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 483fae2..387ddef 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -231,6 +231,12 @@ bool Vocabulary::loadSuffixes() {
// Beginning of next string - skip leading '*'
seeker++;
+ // The QFG2 demo vocab is truncated at the end. Check for such cases here
+ if (seeker >= resource->size()) {
+ warning("Vocabulary word from %s is truncated for suffix %d at %u", resource->name().c_str(), _parserSuffixes.size(), seeker);
+ break;
+ }
+
maxSize = resource->size() - seeker;
suffix.word_suffix = (const char *)resource->getUnsafeDataAt(seeker, maxSize);
suffix.word_suffix_length = Common::strnlen(suffix.word_suffix, maxSize);
More information about the Scummvm-git-logs
mailing list