File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2222#include < validation.h> // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS
2323#include < netbase.h>
2424#include < txdb.h> // for -dbcache defaults
25+ #include < util/strencodings.h>
2526#include < util/underlying.h>
2627
2728#include < QButtonGroup>
@@ -588,7 +589,10 @@ QValidator(parent)
588589QValidator::State ProxyAddressValidator::validate (QString &input, int &pos) const
589590{
590591 Q_UNUSED (pos);
591- // Validate the proxy
592+ uint16_t port{0 };
593+ std::string hostname;
594+ if (!SplitHostPort (input.toStdString (), port, hostname) || port != 0 ) return QValidator::Invalid;
595+
592596 CService serv (LookupNumeric (input.toStdString (), DEFAULT_GUI_PROXY_PORT));
593597 Proxy addrProxy = Proxy (serv, true );
594598 if (addrProxy.IsValid ())
You can’t perform that action at this time.
0 commit comments