mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
bug 100682 domain cookies from sites having IP url's, r=sgehani, sr=alecf
This commit is contained in:
parent
7b84625e46
commit
d678dcb719
@ -405,6 +405,20 @@ PRBool
|
||||
cookie_IsInDomain(char* domain, char* host, int hostLength) {
|
||||
int domainLength = PL_strlen(domain);
|
||||
|
||||
/*
|
||||
* test for domain name being an IP address (e.g., 105.217) and reject if so
|
||||
*/
|
||||
PRBool hasNonDigitChar = PR_FALSE;
|
||||
for (int i = 0; i<domainLength; i++) {
|
||||
if (!nsCRT::IsAsciiDigit(domain[i]) && domain[i] != '.') {
|
||||
hasNonDigitChar = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasNonDigitChar) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* special case for domainName = .hostName
|
||||
* e.g., hostName = netscape.com
|
||||
|
Loading…
x
Reference in New Issue
Block a user