diff options
author | Travis Howell | 2005-04-17 14:20:44 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-17 14:20:44 +0000 |
commit | c673f5250e8f740f5520e6f7c77f410532cdeff6 (patch) | |
tree | 3db5d305b99defbf11fd7d2bf9e3b3cd27bdd7e9 | |
parent | caae2f00de411c7a26f5d5cd0a31fe23a017e501 (diff) | |
download | scummvm-rg350-c673f5250e8f740f5520e6f7c77f410532cdeff6.tar.gz scummvm-rg350-c673f5250e8f740f5520e6f7c77f410532cdeff6.tar.bz2 scummvm-rg350-c673f5250e8f740f5520e6f7c77f410532cdeff6.zip |
Fix buffer overflow regression.
Use same buffer sizes as original.
svn-id: r17654
-rw-r--r-- | scumm/script_v100he.cpp | 2 | ||||
-rw-r--r-- | 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(); |