Repository navigation
Conversation
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.
~1decodes to the wrong byte in decode_pointer_inplaceThis runs on the final path segment of JSON Patch add/remove/replace/move/copy ops. The
~1branch wrote/todecoded_string[1]instead ofdecoded_string[0], and plain characters were never copied into the compacted slot once an escape had shifted the write position, so they kept whatever stale byte was already there. A path like/a~1bthen resolved to a mangled key, so the operation landed on the wrong member or failed outright (/m~0ndecoded tom~0,/a~1btoa~/).Writing to
decoded_string[0]and copying the non-escaped characters makes the result match RFC 6901 (~01->~1,~10->/0). Added patch cases with escaped keys in the destination segment, which exercise the decode path that the existing suite only reached throughtestops (those go through compare_pointers, not this decoder).