зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1873906 - DefaultURI::SetPort now throws an error if port > u16::max. r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D205123
This commit is contained in:
Родитель
03573054e5
Коммит
8ad6d2d634
|
@ -436,6 +436,11 @@ pub extern "C" fn mozurl_set_hostname(url: &mut MozURL, host: &nsACString) -> ns
|
|||
#[no_mangle]
|
||||
pub extern "C" fn mozurl_set_port_no(url: &mut MozURL, new_port: i32) -> nsresult {
|
||||
debug_assert_mut!(url);
|
||||
|
||||
if new_port > u16::MAX as i32 {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if url.cannot_be_a_base() {
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
|
|
@ -25,12 +25,6 @@
|
|||
[url-setters-a-area.window.html?include=mailto]
|
||||
|
||||
[url-setters-a-area.window.html?exclude=(file|javascript|mailto)]
|
||||
[<a>: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <foo://somehost/some/path>.pathname = '' Non-special URLs can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -127,9 +127,6 @@
|
|||
[URL: Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <file://test/>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
|
@ -429,9 +426,6 @@
|
|||
[URL: Setting <non-spec:/.//p>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <foo://somehost/some/path>.pathname = '' Non-special URLs can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -495,9 +489,6 @@
|
|||
[URL: Setting <non-spec:/.//p>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <foo://somehost/some/path>.pathname = '' Non-special URLs can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче