Fix partial path traversal Java example Again#12735
Merged
atorralba merged 3 commits intoApr 3, 2023
Merged
Conversation
Contributor
|
QHelp previews: |
atorralba
reviewed
Mar 31, 2023
Contributor
atorralba
left a comment
There was a problem hiding this comment.
Thanks. Quite the subtlety with Path#startsWith compared to String#startsWith. I had to quickly test it locally to actually understand the difference.
Do you think it makes sense to add this "prime example" as a test, so that we validate that the recommended solution isn't flagged by the query, now and in the future?
Contributor
Author
Yes, I agree it should be added. |
6da65b7 to
90d80ed
Compare
The original wouldn't compile, and the fix made by github#11899 is sub-optimal. This keeps the entire comparision using the Java `Path` object, which is optimal. Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
….inc.qhelp Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
The original wouldn't compile, and the fix made by github#11899 is sub-optimal. This keeps the entire comparision using the Java `Path` object, which is optimal. Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
90d80ed to
0d774a6
Compare
mchammer01
approved these changes
Apr 3, 2023
Contributor
mchammer01
left a comment
There was a problem hiding this comment.
This LGTM from an editorial point of view (only reviewed the qhelp update) ⚡
atorralba
approved these changes
Apr 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original wouldn't compile, and the fix made by #11899 is sub-optimal.
This keeps the entire comparision using the Java
Pathobject, which is optimal.Signed-off-by: Jonathan Leitschuh Jonathan.Leitschuh@gmail.com