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
The code:
case "$token" in
'{') parse_object "$jpath" ;;
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
isleaf=1
[ "$value" = '""' ] && isempty=1
;;
esac
I think there is one issues:
'{' should change to '^{$' ,and '[' should change to '^[$'
this is to prevent that user have a string value "abcd[efg" which will mismatch the pattern.
The text was updated successfully, but these errors were encountered:
Okay, I just added a test for strings with json characters embedded inside it.
and the test passed, I think since the match is literal (single quotes) then it is not matched as a pattern.
looking at this again, you are technically correct about the behavior of this code in this context.
However, this code should have clean input, which will have already been processed by the tokenizer.
It shouldn't be possible to get an illegal character here,
unless you can find a counter example?
The code:
case "$token" in
'{') parse_object "$jpath" ;;
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
isleaf=1
[ "$value" = '""' ] && isempty=1
;;
esac
I think there is one issues:
'{' should change to '^{$' ,and '[' should change to '^[$'
this is to prevent that user have a string value "abcd[efg" which will mismatch the pattern.
The text was updated successfully, but these errors were encountered: