Skip to content

Fix for crash when key contains ~#108

Merged
roshkhatri merged 1 commit into
valkey-io:unstablefrom
zackcam:JSON-del
Jun 10, 2026
Merged

Fix for crash when key contains ~#108
roshkhatri merged 1 commit into
valkey-io:unstablefrom
zackcam:JSON-del

Conversation

@zackcam

@zackcam zackcam commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Fix for issue: #104

Follow RFC 6901 where we set ~ as ~0 to distinguish a regular ~ compared to a ~ created from parsing a /. This fix will set ~ as ~0 for parsing. This will prevent crashes where we originally saw a ~ and expected it to be the start of parsing for a /. We have the order of tilde first so we don't double replace in the loop.

Tests: To make sure this doesnt get changed in the future we have the two scenarios listed in the issues as unit tests now. Without this change the tests would crash causing failures.

@roshkhatri roshkhatri self-requested a review June 9, 2026 03:43

@roshkhatri roshkhatri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

change looks goos, just one minor comment

Comment thread src/json/selector.cc
Signed-off-by: zackcam <zackcam@amazon.com>
@roshkhatri roshkhatri merged commit 8a82675 into valkey-io:unstable Jun 10, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants