hazzik / mpqtool-export

Automatically exported from code.google.com/p/mpqtool
0 stars 1 forks source link

Bug in MpqStream.ZlibDecompress() #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
original code:
            while (true)
            {
                int size = s.Read(Output, Offset, ExpectedLength);
                if (size == 0) break;
                Offset += size;
            }
it should be:
            while (true)
            {
                int size = s.Read(Output, Offset, ExpectedLength);
                if (size == 0) break;
                Offset += size;
                ExpectedLength -= size;
            }
otherwise SharpZipLib will report an Exception says "count exceeds buffer
bounds". To verify, please use MpqTool to extract "Scripts\common.j" within
"War3Patch.mpq" comes with Warcraft III.

Original issue reported on code.google.com by deerc...@gmail.com on 23 Jul 2007 at 3:36

GoogleCodeExporter commented 9 years ago
I'm surprised this wasn't found sooner!  I'll apply your fix soon.

Original comment by fool...@gmail.com on 24 Jul 2007 at 1:11

GoogleCodeExporter commented 9 years ago
Fixed in svn revision 5.

Original comment by fool...@gmail.com on 25 Jul 2007 at 9:16