Merge pull request #8955 from furo321/url-master-parsing

Don't allow URLs without port from the masterserver
This commit is contained in:
Dennis Felsing 2024-09-15 09:28:43 +00:00 committed by GitHub
commit 4b6f2e22a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -424,7 +424,10 @@ void CServerBrowserHttp::Refresh()
}
bool ServerbrowserParseUrl(NETADDR *pOut, const char *pUrl)
{
return net_addr_from_url(pOut, pUrl, nullptr, 0) != 0;
int Failure = net_addr_from_url(pOut, pUrl, nullptr, 0);
if(Failure || pOut->port == 0)
return true;
return false;
}
bool CServerBrowserHttp::Validate(json_value *pJson)
{