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

Strangerke Strangerke at scummvm.org
Thu Apr 18 08:11:21 CEST 2013


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

Summary:
0aa028c3f1 CGE: Add safeguard in expand()
e4ec07a6a1 CGE: Add safeguards in text manager


Commit: 0aa028c3f14ae97f2bea6e2ca21ad987833e9eac
    https://github.com/scummvm/scummvm/commit/0aa028c3f14ae97f2bea6e2ca21ad987833e9eac
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-04-17T22:57:26-07:00

Commit Message:
CGE: Add safeguard in expand()

Changed paths:
    engines/cge/vga13h.cpp



diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index e178795..56a0754 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -214,6 +214,7 @@ Sprite *Sprite::expand() {
 
 		for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) {
 			len = line.size();
+			assert(len <= 513);
 			strcpy(tmpStr, line.c_str());
 			lcnt++;
 			if (len == 0 || *tmpStr == '.')


Commit: e4ec07a6a1e6ad9f5f72912332ec47742b832f7f
    https://github.com/scummvm/scummvm/commit/e4ec07a6a1e6ad9f5f72912332ec47742b832f7f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-04-17T23:10:07-07:00

Commit Message:
CGE: Add safeguards in text manager

Changed paths:
    engines/cge/text.cpp



diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index a8ce877..27bb060 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -68,7 +68,7 @@ int16 Text::count() {
 
 	for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) {
 		char *s;
-
+		assert(line.size() <= 513);
 		strcpy(tmpStr, line.c_str());
 		if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
 			continue;
@@ -101,7 +101,7 @@ void Text::load() {
 	for (idx = 0, line = tf.readLine(); !tf.eos(); line = tf.readLine()) {
 		int n = line.size();
 		char *s;
-
+		assert(n <= 513);
 		strcpy(tmpStr, line.c_str());
 		if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
 			continue;






More information about the Scummvm-git-logs mailing list