зеркало из https://github.com/mozilla/gecko-dev.git
fixes bug 318006, r=biesi, sr=dveditz
This commit is contained in:
Родитель
313ad0fa87
Коммит
c9004b71dd
|
@ -897,7 +897,7 @@ PRBool
|
|||
net_IsValidHostName(const nsCSubstring &host)
|
||||
{
|
||||
const char *end = host.EndReading();
|
||||
// ctrl-chars and !\"#%&'()*+,/;<=>?@\\^{|}\x7f
|
||||
// ctrl-chars and !\"#%&'()*,/;<=>?@\\^{|}\x7f
|
||||
// if one of these chars is found return false
|
||||
return net_FindCharInSet(host.BeginReading(), end,
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08"
|
||||
|
@ -905,6 +905,6 @@ net_IsValidHostName(const nsCSubstring &host)
|
|||
"\x11\x12\x13\x14\x15\x16\x17\x18"
|
||||
"\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
|
||||
"\x21\x22\x23\x25\x26\x27\x28\x29"
|
||||
"\x2a\x2b\x2c\x2f\x3b\x3c\x3d\x3e"
|
||||
"\x2a\x2c\x2f\x3b\x3c\x3d\x3e"
|
||||
"\x3f\x40\x5c\x5e\x7b\x7c\x7e\x7f") == end;
|
||||
}
|
||||
|
|
|
@ -263,6 +263,10 @@ nsHttpChannel::Connect(PRBool firstTime)
|
|||
|
||||
LOG(("nsHttpChannel::Connect [this=%x]\n", this));
|
||||
|
||||
// ensure that we are using a valid hostname
|
||||
if (!net_IsValidHostName(nsDependentCString(mConnectionInfo->Host())))
|
||||
return NS_ERROR_UNKNOWN_HOST;
|
||||
|
||||
// true when called from AsyncOpen
|
||||
if (firstTime) {
|
||||
PRBool delayed = PR_FALSE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче