Fixing NullPointerException on valueless query parameters in URITools - #709
Open
Myllyenko wants to merge 1 commit into
Open
Fixing NullPointerException on valueless query parameters in URITools#709Myllyenko wants to merge 1 commit into
Myllyenko wants to merge 1 commit into
Conversation
splitQueryParameter deliberately maps a parameter with no value to null, then passed that null straight to URLDecoder.decode, which rejects it. So any connection string of the form "?flag" or "?database=" blew up with a NullPointerException instead of being parsed. The same code path is used to read node_id out of session ids in BaseSession and SessionImpl. Make decode null-safe and keep the intended null value.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #709 +/- ##
============================================
+ Coverage 71.91% 72.45% +0.54%
- Complexity 3474 3526 +52
============================================
Files 390 391 +1
Lines 16220 16343 +123
Branches 1698 1702 +4
============================================
+ Hits 11664 11842 +178
+ Misses 3904 3860 -44
+ Partials 652 641 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
URITools.splitQueryParametermapped a query parameter with no value tonull, then passed thatnulltoURLDecoder.decode, which threwNullPointerException. So any connection string of the form?parameteror?parameter=causedNullPointerException.