From f05ce6f697406d32d974f57b8d537fcd513496d5 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:35:44 +0100 Subject: [PATCH] Fixed SOCKS5 proxy detection `std::stoul` can throw an exception, so don't use it. --- src/params.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/params.cpp b/src/params.cpp index 17871b1..494a050 100644 --- a/src/params.cpp +++ b/src/params.cpp @@ -456,7 +456,7 @@ Params::Params(const std::vector>& args) const size_t k = m_socks5Proxy.find_last_of(':'); if ((k != std::string::npos) && (k < m_socks5Proxy.length() - 1)) { - const uint32_t port = std::stoul(m_socks5Proxy.substr(k + 1), nullptr, 10); + const unsigned long port = strtoul(m_socks5Proxy.substr(k + 1).c_str(), nullptr, 10); if ((port > 0) && (port < 65536)) { switch (port) { @@ -524,7 +524,7 @@ bool Params::valid() const } if (m_socks5ProxyType == ProxyType::INVALID) { - LOGERR(1, "Invalid SOCKS5 proxy type. Check the --socks5-proxy-type parameter."); + LOGERR(1, "Invalid SOCKS5 proxy type. Check the --socks5 and --socks5-proxy-type parameters."); return false; }