diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-05-02 02:55:10 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-05-02 02:55:10 +0200 |
| commit | 6955d7c9ad0e55480aa97d9cafd878c6bc3dc426 (patch) | |
| tree | 2a0b11c84a75607ac9db4c6f0d2382d7157230a7 /src/server/authserver/Server/BattlenetBitStream.h | |
| parent | fea9d275fa0ed8f5b43dc54979cdd5a58afc993b (diff) | |
Core/Battle.net
* Fixed AuthResult codes
* Fixed BitStream::WriteBytes size check
* Fixed comparison operator for packet header
* Fixed channel for client packets without channel
* Implemented loading modules from database
Diffstat (limited to 'src/server/authserver/Server/BattlenetBitStream.h')
| -rw-r--r-- | src/server/authserver/Server/BattlenetBitStream.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/authserver/Server/BattlenetBitStream.h b/src/server/authserver/Server/BattlenetBitStream.h index 4b6c7f882d4..d372e0933c2 100644 --- a/src/server/authserver/Server/BattlenetBitStream.h +++ b/src/server/authserver/Server/BattlenetBitStream.h @@ -22,16 +22,21 @@ #include <exception> #include <string> #include <vector> +#include <ace/Stack_Trace.h> namespace Battlenet { class BitStreamPositionException : public std::exception { public: + BitStreamPositionException() : st(1) { } + char const* what() const { - return ""; + return st.c_str(); } + + ACE_Stack_Trace st; }; class BitStream @@ -121,7 +126,10 @@ namespace Battlenet void WriteBytes(T* data, uint32 count) { AlignToNextByte(); - if (_writePos + 8 * count > MaxSize) + if (!count || !data) + return; + + if (_writePos + count > MaxSize) throw BitStreamPositionException(); _buffer.resize(_buffer.size() + count); |
