Restrict proxy server name length.
GitOrigin-RevId: d2e18866ff7fd977655cf27c3295b716237d92c7
This commit is contained in:
parent
2f9db6e6e6
commit
59f938405e
@ -157,7 +157,7 @@ class TlsHelloContext {
|
||||
return grease_.size();
|
||||
}
|
||||
Slice get_domain() const {
|
||||
return domain_;
|
||||
return Slice(domain_).substr(0, 255);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -17,6 +17,9 @@ Result<Proxy> Proxy::from_td_api(string server, int port, td_api::ProxyType *pro
|
||||
if (server.empty()) {
|
||||
return Status::Error(400, "Server name can't be empty");
|
||||
}
|
||||
if (server.size() > 255) {
|
||||
return Status::Error(400, "Server name is too long");
|
||||
}
|
||||
if (port <= 0 || port > 65535) {
|
||||
return Status::Error(400, "Wrong port number");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user