Skip to content

Commit

Permalink
gui: don't permit port in proxy IP option
Browse files Browse the repository at this point in the history
Fixes: #809

Previously it was possible through the GUI to enter an IP address:port
into the "Proxy IP" configuration box. After the node was restarted the
errant setting would prevent the node starting back up until manually
removed from settings.json.

Prevent this with a simple check for ":" in the string. This is
acceptable here in the GUI setting because we already fail on a hostname
such as "http://x.x.x.x", so it won't cause false positives.
  • Loading branch information
willcl-ark committed Apr 3, 2024
1 parent 0d509ba commit 94173ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ QValidator(parent)
QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const
{
Q_UNUSED(pos);
// Validate the proxy
// "http://x.x.x.x" already prohibited, so safe to fail early here on a ":"
if (input.contains(':')) {
return QValidator::Invalid;
}
CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
Proxy addrProxy = Proxy(serv, true);
if (addrProxy.IsValid())
Expand Down

0 comments on commit 94173ea

Please sign in to comment.