Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
SocksProxy: check for null socket in handler
Browse files Browse the repository at this point in the history
Performs checks before dereferencing the handler's socket pointer.
  • Loading branch information
coneiric committed Aug 22, 2018
1 parent 74dfd48 commit 418ea8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/proxy/socks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 418ea8f

Please sign in to comment.