-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: panic when head-skipping to a single-byte key
- This was detected by fuzzing! Searching for `{` or `[` with descendant would cause a panic if the input started with the sequence `{"` or `["`, respectively. Ref: #281
- Loading branch information
Showing
14 changed files
with
1,949 additions
and
779 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
26 changes: 26 additions & 0 deletions
26
crates/rsonpath-lib/tests/documents/toml/head_skip_for_curly.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "Object with an empty key." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = false | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = '{"":null}' | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = '$..["{"]' | ||
# Short descritpion of the query semantics. | ||
description = "descendant search for a key equal to the curly brace" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 0 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = [] |
26 changes: 26 additions & 0 deletions
26
crates/rsonpath-lib/tests/documents/toml/head_skip_for_square.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Define the JSON input for all query test cases. | ||
[input] | ||
# Short description of the input structure. | ||
description = "List with an empty string." | ||
# Set to true only if your specific test input is fully compressed (no extraneous whitespace). | ||
is_compressed = false | ||
|
||
# Inline JSON document. | ||
[input.source] | ||
json_string = '[""]' | ||
|
||
# Define queries to test on the input. | ||
[[queries]] | ||
# Valid JSONPath query string. | ||
query = '$..["["]' | ||
# Short descritpion of the query semantics. | ||
description = "descendant search for a key equal to the square brace" | ||
|
||
[queries.results] | ||
# Number of expected matches. | ||
count = 0 | ||
# Byte locations of spans of all matches, in order. | ||
spans = [] | ||
# Stringified values of all matches, verbatim as in the input, | ||
# in the same order as above. | ||
nodes = [] |
Oops, something went wrong.