Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL: test port parsing when integer overflow can occur #7602

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

rmisev
Copy link
Member

@rmisev rmisev commented Oct 6, 2017

Tests folowing numbers as port:

232 + 81 = 4294967377
264 + 81 = 18446744073709551697
2128 + 81 = 340282366920938463463374607431768211537

If an integer overflow checking is implemented incorrectly then the port may be parsed to 81. But an implementation must return failure.

Related bug fix: nodejs/node#15794

Tests folowing numbers as port:

2^32 + 81 = 4294967377
2^64 + 81 = 18446744073709551697
2^128 + 81 = 340282366920938463463374607431768211537

If an integer overflow checking is implemented incorrectly then the port
may be parsed to 81. But an implementation must return failure.
@ghost
Copy link

ghost commented Oct 6, 2017

Build PASSED

Started: 2017-10-06 09:42:59
Finished: 2017-10-06 10:00:16

This report has been truncated because the number of unstable tests exceeds GitHub.com's character limit for comments (65536 characters).

Failing Jobs

  • MicrosoftEdge:14.14393

Unstable Browsers

Browser: "Microsoftedge 14.14393" (failures allowed)

View in: WPT PR Status | TravisCI

@annevk annevk merged commit 11757f1 into web-platform-tests:master Oct 6, 2017
rmisev added a commit to rmisev/node that referenced this pull request Oct 6, 2017
@rmisev rmisev deleted the url-port-overflow branch October 6, 2017 14:12
@rmisev rmisev restored the url-port-overflow branch October 6, 2017 14:13
@rmisev rmisev deleted the url-port-overflow branch October 6, 2017 14:14
TimothyGu pushed a commit to nodejs/node that referenced this pull request Oct 10, 2017
This patch adds (port > 0xffff) check after each digit in the loop and
prevents integer overflow.

PR-URL: #15794
Refs: web-platform-tests/wpt#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>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 12, 2017
This patch adds (port > 0xffff) check after each digit in the loop and
prevents integer overflow.

PR-URL: nodejs/node#15794
Refs: web-platform-tests/wpt#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>
targos pushed a commit to nodejs/node that referenced this pull request Oct 18, 2017
This patch adds (port > 0xffff) check after each digit in the loop and
prevents integer overflow.

PR-URL: #15794
Refs: web-platform-tests/wpt#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants