You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Most expressions that miss the closing brace (}) or bracket (]) will cause a segfault. Some expressions that miss the closing parenthesis ()) evaluate successfully (although jq errors on these expressions), but specially crafted expressions are able to hit the same segfault.
Version of yq: 4.12.1
Operating system: mac
Installed via: binary homebrew
Command
The command you ran:
yq e --null-input '({"foo": ["bar"}'
yq e --null-input '{"foo": "bar"'
yq e --null-input '[(.bar |= "baz")'
yq e --null-input '({"foo": ("bar"}'
Actual behavior
(some values vary from expression to expression, but are consistent; i'm guessing those are offsets or something in the input. However, the stack is the same for all of the commands)
Describe the bug
Most expressions that miss the closing brace (
}
) or bracket (]
) will cause a segfault. Some expressions that miss the closing parenthesis ()
) evaluate successfully (althoughjq
errors on these expressions), but specially crafted expressions are able to hit the same segfault.Version of yq: 4.12.1
Operating system: mac
Installed via: binary homebrew
Command
The command you ran:
Actual behavior
(some values vary from expression to expression, but are consistent; i'm guessing those are offsets or something in the input. However, the stack is the same for all of the commands)
Expected behavior
Additional context
evaluates successfully.
jq equivalents
``` $ jq --null-input '([{"foo": ["bar"]]}' jq: error: syntax error, unexpected INVALID_CHARACTER, expecting '}' (Unix shell quoting issues?) at , line 1: ([{"foo": ["bar"]]}$ jq --null-input '({"foo": ["bar"}'
jq: error: syntax error, unexpected INVALID_CHARACTER (Unix shell quoting issues?) at , line 1:
({"foo": ["bar"}
jq: 1 compile error
$ jq --null-input '{"foo": "bar"'
jq: error: syntax error, unexpected $end, expecting '}' (Unix shell quoting issues?) at , line 1:
{"foo": "bar"
jq: 1 compile error
$ jq --null-input '[(.bar |= "baz")'
jq: error: syntax error, unexpected $end (Unix shell quoting issues?) at , line 1:
[(.bar |= "baz")
jq: 1 compile error
$ jq --null-input '({"foo": ("bar"}'
jq: error: syntax error, unexpected INVALID_CHARACTER (Unix shell quoting issues?) at , line 1:
({"foo": ("bar"}
jq: 1 compile error
The text was updated successfully, but these errors were encountered: