diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index cd7abd98..47ca2b20 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -27,12 +27,19 @@ namespace network const auto cmd_string = utils::string::to_lower(command); auto& callbacks = get_callbacks(); const auto handler = callbacks.find(cmd_string); + if (handler == callbacks.end()) { return false; } const auto offset = cmd_string.size() + 5; + + if (message->cursize <= offset) + { + return false; + } + const std::string_view data(message->data + offset, message->cursize - offset); handler->second(*address, data);