diff options
-rw-r--r-- | src/server/game/DataStores/DBCStores.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Handlers/MiscHandler.cpp | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 6647fa08fc2..31d9cfa7e4e 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -248,7 +248,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt // compatibility format and C++ structure sizes ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T), "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).", - filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T)); + filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T))); ++DBCFileCount; std::string dbcFilename = dbcPath + filename; @@ -296,7 +296,7 @@ inline void LoadGameTable(StoreProblemList& errors, std::string const& tableName // compatibility format and C++ structure sizes ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T), "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).", - filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T)); + filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T))); ++DBCFileCount; std::string dbcFilename = dbcPath + filename; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 9598ce216fb..e97b7f1c247 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1498,6 +1498,13 @@ void WorldSession::HandleTimeSyncResp(WorldPackets::Misc::TimeSyncResponse& pack { TC_LOG_DEBUG("network", "CMSG_TIME_SYNC_RESP"); + // Prevent crashing server if queue is empty + if (_player->m_timeSyncQueue.empty()) + { + TC_LOG_ERROR("network", "Received CMSG_TIME_SYNC_RESP from player %s without requesting it (hacker?)", _player->GetName().c_str()); + return; + } + if (packet.SequenceIndex != _player->m_timeSyncQueue.front()) TC_LOG_ERROR("network", "Wrong time sync counter from player %s (cheater?)", _player->GetName().c_str()); |