Bug 1552993 - r=valentin,dragana
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 27 May 2019 09:14:33 +0000
changeset 476208 0ab7cdd094046de37787bc0b7dc68d9f2db5a8b9
parent 476207 97259cdb13db80d2155a861f1031530dba1ee54d
child 476209 79a4c6547690cf6fe24c124933d830e2151ea9ff
push id36089
push usernbeleuzu@mozilla.com
push dateThu, 30 May 2019 21:48:30 +0000
treeherdermozilla-central@e09471d13659 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, dragana
bugs1552993
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1552993 - r=valentin,dragana Differential Revision: https://phabricator.services.mozilla.com/D32066
netwerk/protocol/http/AlternateServices.cpp
--- a/netwerk/protocol/http/AlternateServices.cpp
+++ b/netwerk/protocol/http/AlternateServices.cpp
@@ -124,16 +124,21 @@ void AltSvcMapping::ProcessHeader(
       originAttributes.CreateSuffix(suffix);
       LOG(("Alt Svc clearing mapping for %s:%d:%s", originHost.get(),
            originPort, suffix.get()));
       gHttpHandler->ConnMgr()->ClearHostMapping(originHost, originPort,
                                                 originAttributes);
       continue;
     }
 
+    if (NS_FAILED(NS_CheckPortSafety(portno, originScheme.get()))) {
+      LOG(("Alt Svc doesn't allow port %d, ignoring", portno));
+      continue;
+    }
+
     // unescape modifies a c string in place, so afterwards
     // update nsCString length
     nsUnescape(npnToken.BeginWriting());
     npnToken.SetLength(strlen(npnToken.BeginReading()));
 
     uint32_t spdyIndex;
     SpdyInformation* spdyInfo = gHttpHandler->SpdyInfo();
     if (!(NS_SUCCEEDED(spdyInfo->GetNPNIndex(npnToken, &spdyIndex)) &&