aboutsummaryrefslogtreecommitdiff
path: root/src/game/MiscHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-30 10:39:53 +0800
committermegamage <none@none>2009-07-30 10:39:53 +0800
commitb2b3983e8976a5656e6d3cc79f5b04c9b773e881 (patch)
tree39e31476945a50b336d0b2126f81e9e207292cf8 /src/game/MiscHandler.cpp
parent5d9d64e6f048298a19f4c80795f05e31facb2318 (diff)
[8231] Use more safe destination buffer size for zlib compression. Author: SilverIce
[8230] Add new line at the end of file Player.h to make gcc happy. Author: Gendalph --HG-- branch : trunk
Diffstat (limited to 'src/game/MiscHandler.cpp')
-rw-r--r--src/game/MiscHandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index 2488e7696e0..c2a93c36e0c 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -1018,10 +1018,11 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
uint32 size = adata->Data.size();
+ uLongf destSize = compressBound(size);
+
ByteBuffer dest;
- dest.resize(size);
+ dest.resize(destSize);
- uLongf destSize = size;
if(size && compress(const_cast<uint8*>(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK)
{
sLog.outDebug("RAD: Failed to compress account data");