From 418ea8f347e8d3d23aa7feef771a2900e601ed0c Mon Sep 17 00:00:00 2001 From: oneiric Date: Wed, 18 Jul 2018 00:53:55 +0000 Subject: [PATCH] SocksProxy: check for null socket in handler Performs checks before dereferencing the handler's socket pointer. --- src/client/proxy/socks.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/proxy/socks.cc b/src/client/proxy/socks.cc index 30b47981..797e9ec6 100644 --- a/src/client/proxy/socks.cc +++ b/src/client/proxy/socks.cc @@ -62,6 +62,12 @@ SOCKSHandler::SOCKSHandler( m_AddressType(IPv4), m_SOCKSVersion(SOCKS5), m_Command(Connect) { + if (!parent) + throw std::invalid_argument( + __func__ + std::string(": null server")); + if (!socket) + throw std::invalid_argument( + __func__ + std::string(": null socket")); m_Address.ip = 0; EnterState(GetSOCKSVersion); }