Bug 326528: fix out-of-bound error in pref reading code, r+sr=darin

This commit is contained in:
gavin%gavinsharp.com 2006-06-26 00:05:15 +00:00
Родитель 4aba535053
Коммит 8e58e8242a
2 изменённых файлов: 2 добавлений и 2 удалений

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

@ -408,7 +408,7 @@ nsHttpNegotiateAuth::MatchesBaseURI(const nsCSubstring &matchScheme,
// XXX this does not work for IPv6-literals
const char *hostEnd = strchr(hostStart, ':');
if (hostEnd && hostEnd <= baseEnd) {
if (hostEnd && hostEnd < baseEnd) {
// the given port must match the parsed port exactly
int port = atoi(hostEnd + 1);
if (matchPort != (PRInt32) port)

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

@ -83,7 +83,7 @@ MatchesBaseURI(const nsCSubstring &matchScheme,
// XXX this does not work for IPv6-literals
const char *hostEnd = strchr(hostStart, ':');
if (hostEnd && hostEnd <= baseEnd) {
if (hostEnd && hostEnd < baseEnd) {
// the given port must match the parsed port exactly
int port = atoi(hostEnd + 1);
if (matchPort != (PRInt32) port)