Check port safety for AltSvc

This commit is contained in:
wolfbeast 2019-07-20 13:59:45 +02:00 committed by Roy Tam
commit 4e15e1fec0

View file

@ -121,6 +121,11 @@ AltSvcMapping::ProcessHeader(const nsCString &buf, const nsCString &originScheme
continue;
}
if (NS_FAILED(NS_CheckPortSafety(portno, originScheme.get()))) {
LOG(("Alt Svc does not allow port %d, ignoring request", portno));
continue;
}
// unescape modifies a c string in place, so afterwards
// update nsCString length
nsUnescape(npnToken.BeginWriting());