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: fix remaining calculation #15637

Closed
wants to merge 1 commit into from
Closed

Conversation

rmisev
Copy link
Contributor

@rmisev rmisev commented Sep 27, 2017

Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

In the current implementation the calculated length exceeds the actual remaining's size and can cause incorrect result. For example:

std::string dest;
PercentDecode("%21", 1, &dest);
// actual: dest == "!"
// expected: dest == "%" (because len is 1)

Related PR: #15593

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

url

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v4.x whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Sep 27, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I'd like @TimothyGu to give it a look

Copy link
Member

@TimothyGu TimothyGu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not sure how the bug got in there in the first place. It's calculated correctly everywhere else in the file.

@TimothyGu
Copy link
Member

jasnell pushed a commit that referenced this pull request Sep 29, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: #15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
@jasnell
Copy link
Member

jasnell commented Sep 29, 2017

Landed in 09b703b

@jasnell jasnell closed this Sep 29, 2017
@rmisev rmisev deleted the url-fix-remaining branch September 29, 2017 18:02
MylesBorins pushed a commit that referenced this pull request Sep 29, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: #15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 30, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: nodejs/node#15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: #15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Oct 3, 2017
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: #15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
Fix remaining calculation in the PercentDecode function to match the
definition in URL standard: https://url.spec.whatwg.org/#remaining

PR-URL: #15637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants