зеркало из https://github.com/mozilla/pjs.git
fixes bug 242446 "nsHttpNegotiateAuth::MatchesBaseURI fixes" patch by cneberg@sandia.gov r+sr=darin
This commit is contained in:
Родитель
f910f6d04e
Коммит
5024b83544
|
@ -357,7 +357,7 @@ nsHttpNegotiateAuth::MatchesBaseURI(const nsCSubstring &matchScheme,
|
|||
|
||||
// XXX this does not work for IPv6-literals
|
||||
const char *hostEnd = strchr(hostStart, ':');
|
||||
if (hostEnd) {
|
||||
if (hostEnd && hostEnd <= baseEnd) {
|
||||
// the given port must match the parsed port exactly
|
||||
int port = atoi(hostEnd + 1);
|
||||
if (matchPort != (PRInt32) port)
|
||||
|
@ -373,8 +373,8 @@ nsHttpNegotiateAuth::MatchesBaseURI(const nsCSubstring &matchScheme,
|
|||
|
||||
PRUint32 hostLen = hostEnd - hostStart;
|
||||
|
||||
// now, allow host to be a subdomain of matchHost
|
||||
if (matchHost.Length() > hostLen)
|
||||
// matchHost must either equal host or be a subdomain of host
|
||||
if (matchHost.Length() < hostLen)
|
||||
return PR_FALSE;
|
||||
|
||||
const char *end = matchHost.EndReading();
|
||||
|
|
Загрузка…
Ссылка в новой задаче