From c673f5250e8f740f5520e6f7c77f410532cdeff6 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 17 Apr 2005 14:20:44 +0000 Subject: Fix buffer overflow regression. Use same buffer sizes as original. svn-id: r17654 --- scumm/script_v100he.cpp | 2 +- scumm/script_v72he.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index b9485cf0b3..893f7066af 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -585,7 +585,7 @@ void ScummEngine_v100he::o100_arrayOps() { int id, len, b, c; ArrayHeader *ah; int list[128]; - byte string[2048]; + byte string[1024]; debug(1,"o100_arrayOps: case %d", subOp); switch (subOp) { diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 3ad79b794a..e23ddeb539 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -519,7 +519,7 @@ void ScummEngine_v72he::readArrayFromIndexFile() { } void ScummEngine_v72he::copyScriptString(byte *dst, int dstSize) { - byte string[256]; + byte string[1024]; byte chr; int pos = 0; @@ -560,7 +560,7 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) { const byte *src; int args[31]; int num, len, val; - byte chr, string[256]; + byte chr, string[1024]; memset(args, 0, sizeof(args)); memset(string, 0, sizeof(string)); @@ -1411,7 +1411,7 @@ void ScummEngine_v72he::o72_arrayOps() { int id, len, b, c; ArrayHeader *ah; int list[128]; - byte string[2048]; + byte string[1024]; debug(1,"o72_arrayOps: case %d", subOp); @@ -1844,14 +1844,14 @@ void ScummEngine_v72he::o72_findAllObjects() { } void ScummEngine_v72he::o72_deleteFile() { - byte filename[100]; + byte filename[256]; copyScriptString(filename, sizeof(filename)); debug(1, "stub o72_deleteFile(%s)", filename); } void ScummEngine_v72he::o72_rename() { - byte oldFilename[256],newFilename[256]; + byte oldFilename[100],newFilename[100]; copyScriptString(newFilename, sizeof(newFilename)); copyScriptString(oldFilename, sizeof(oldFilename)); @@ -2091,7 +2091,7 @@ void ScummEngine_v72he::o72_checkGlobQueue() { } void ScummEngine_v72he::o72_readINI() { - byte option[100]; + byte option[128]; ArrayHeader *ah; const char *entry; int len, type; @@ -2172,13 +2172,13 @@ void ScummEngine_v72he::o72_getResourceSize() { void ScummEngine_v72he::o72_setFilePath() { // File related - byte filename[100]; + byte filename[255]; copyScriptString(filename, sizeof(filename)); debug(1,"o72_setFilePath: %s", filename); } void ScummEngine_v72he::o72_setWindowCaption() { - byte name[100]; + byte name[1024]; copyScriptString(name, sizeof(name)); int id = fetchScriptByte(); -- cgit v1.2.3