fixes bug 242446 "nsHttpNegotiateAuth::MatchesBaseURI fixes" patch by cneberg@sandia.gov r+sr=darin

This commit is contained in:
darin%meer.net 2005-08-09 23:06:41 +00:00
Родитель f910f6d04e
Коммит 5024b83544
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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();