aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Server/AuthSocket.cpp
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-08-30 19:07:59 +0100
committerNay <dnpd.dd@gmail.com>2012-08-30 19:07:59 +0100
commit5f1977cb1d690d2e60a1f5355244ec472e014278 (patch)
treed1f8e9741db0f837fd955e069c6cb63caa08cd58 /src/server/authserver/Server/AuthSocket.cpp
parent902d48811ee476e735e5bc0ad61f9948888db82c (diff)
Core: Fix many "errors"/warnings and coding style (1)
Extractors, worldserver, authserver, shared and collision affected Errors were found using Cppcheck, open-source static analysis tool
Diffstat (limited to 'src/server/authserver/Server/AuthSocket.cpp')
-rwxr-xr-xsrc/server/authserver/Server/AuthSocket.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 2ad80c7f62d..ee3a9677130 100755
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -196,7 +196,7 @@ const AuthHandler table[] =
Patcher PatchesCache;
// Constructor - set the N and g values for SRP6
-AuthSocket::AuthSocket(RealmSocket& socket) : socket_(socket)
+AuthSocket::AuthSocket(RealmSocket& socket) : socket_(socket), pPatch(NULL)
{
N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
g.SetDword(7);
@@ -869,7 +869,7 @@ bool AuthSocket::_HandleRealmList()
flag &= ~REALM_FLAG_SPECIFYBUILD;
std::string name = i->first;
- if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
+ if (buildInfo && (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD))
{
std::ostringstream ss;
ss << name << " (" << buildInfo->MajorVersion << '.' << buildInfo->MinorVersion << '.' << buildInfo->BugfixVersion << ')';
@@ -902,10 +902,15 @@ bool AuthSocket::_HandleRealmList()
if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
{
- pkt << uint8(buildInfo->MajorVersion);
- pkt << uint8(buildInfo->MinorVersion);
- pkt << uint8(buildInfo->BugfixVersion);
- pkt << uint16(buildInfo->Build);
+ if (buildInfo)
+ {
+ pkt << uint8(buildInfo->MajorVersion);
+ pkt << uint8(buildInfo->MinorVersion);
+ pkt << uint8(buildInfo->BugfixVersion);
+ pkt << uint16(buildInfo->Build);
+ }
+ else
+ pkt << uint8(0) << uint8(0) << uint8(0) << uint16(0);
}
++RealmListSize;
@@ -946,7 +951,7 @@ bool AuthSocket::_HandleXferResume()
{
sLog->outDebug(LOG_FILTER_AUTHSERVER, "Entering _HandleXferResume");
// Check packet length and patch existence
- if (socket().recv_len() < 9 || !pPatch)
+ if (socket().recv_len() < 9 || !pPatch) // FIXME: pPatch is never used
{
sLog->outError(LOG_FILTER_AUTHSERVER, "Error while resuming patch transfer (wrong packet)");
return false;