From add439de0003a2bda0fe11d04e87850860ef140e Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 22 Aug 2020 21:57:53 +0200 Subject: [PATCH] Fixed a crash --- server/src/client/voice/CryptSetupHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/client/voice/CryptSetupHandler.cpp b/server/src/client/voice/CryptSetupHandler.cpp index add0a34..ac80652 100644 --- a/server/src/client/voice/CryptSetupHandler.cpp +++ b/server/src/client/voice/CryptSetupHandler.cpp @@ -242,6 +242,10 @@ CryptSetupHandler::CommandResult CryptSetupHandler::handleCommandClientInitIv(co CryptSetupHandler::CommandResult CryptSetupHandler::handleCommandClientEk(const ts::command_parser &cmd) { debugMessage(this->connection->virtual_server_id(), "{} Got client ek!", this->connection->log_prefix()); + if(!this->chain_data || !this->chain_data->chain) { + return ts::command_result{error::vs_critical, "missing chain data"}; + } + auto client_key = base64::decode(cmd.value("ek")); auto private_key = this->chain_data->chain->generatePrivateKey(this->chain_data->root_key, this->chain_data->root_index);