diff options
author | Rimas Misevičius <rmisev3@gmail.com> | 2017-10-02 22:18:06 +0300 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-10-10 08:13:19 -0700 |
commit | 92146e00fd74890ec0e977c8f9592ddaae0314d4 (patch) | |
tree | 4c4c6225da27e99c08a5500b0d9d5587eb55d72c /test/fixtures | |
parent | 85a5a2c228594005280d4b7cd70741eae575a490 (diff) | |
download | android-node-v8-92146e00fd74890ec0e977c8f9592ddaae0314d4.tar.gz android-node-v8-92146e00fd74890ec0e977c8f9592ddaae0314d4.tar.bz2 android-node-v8-92146e00fd74890ec0e977c8f9592ddaae0314d4.zip |
url: fix port overflow checking
This patch adds (port > 0xffff) check after each digit in the loop and
prevents integer overflow.
PR-URL: https://github.com/nodejs/node/pull/15794
Refs: https://github.com/w3c/web-platform-tests/pull/7602
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/url-tests.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/fixtures/url-tests.js b/test/fixtures/url-tests.js index b4db586f44..48f77fe077 100644 --- a/test/fixtures/url-tests.js +++ b/test/fixtures/url-tests.js @@ -2,7 +2,7 @@ /* The following tests are copied from WPT. Modifications to them should be upstreamed first. Refs: - https://github.com/w3c/web-platform-tests/blob/5d149f0/url/urltestdata.json + https://github.com/w3c/web-platform-tests/blob/11757f1/url/urltestdata.json License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html */ module.exports = @@ -5811,6 +5811,24 @@ module.exports = "base": "about:blank", "failure": true }, + "Port overflow (2^32 + 81)", + { + "input": "http://f:4294967377/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^64 + 81)", + { + "input": "http://f:18446744073709551697/c", + "base": "http://example.org/", + "failure": true + }, + "Port overflow (2^128 + 81)", + { + "input": "http://f:340282366920938463463374607431768211537/c", + "base": "http://example.org/", + "failure": true + }, "# Non-special-URL path tests", { "input": "sc://ñ", |