aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_kyradat
diff options
context:
space:
mode:
authorathrxx2012-12-28 01:31:13 +0100
committerathrxx2013-01-09 20:22:26 +0100
commita7c77e8104019f8958b399ef00980ebf32ae71b6 (patch)
treed744c47ec1497e17df654a8b5657582a38558c08 /devtools/create_kyradat
parent4eba2a7e54840f74dc741d960432dc3f7e0cc8a0 (diff)
downloadscummvm-rg350-a7c77e8104019f8958b399ef00980ebf32ae71b6.tar.gz
scummvm-rg350-a7c77e8104019f8958b399ef00980ebf32ae71b6.tar.bz2
scummvm-rg350-a7c77e8104019f8958b399ef00980ebf32ae71b6.zip
KYRA: fix invalid mem access in kyradat tool
Diffstat (limited to 'devtools/create_kyradat')
-rw-r--r--devtools/create_kyradat/extract.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp
index 86244fce42..7388a32769 100644
--- a/devtools/create_kyradat/extract.cpp
+++ b/devtools/create_kyradat/extract.cpp
@@ -965,12 +965,13 @@ bool extractPaddedStrings(PAKFile &out, const ExtractInformation *info, const by
src++;
while (*src && src < fin)
*dst++ = *src++;
-
- *dst++ = '\0';
+ if (src < fin)
+ *dst++ = *src++;
entries++;
}
WRITE_BE_UINT32(buffer, entries);
+
outsize = dst - buffer;
return out.addFile(filename, buffer, outsize);