Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinite loop when trying to convert JSONX with extra comma #2

Open
skunkworker opened this issue Feb 7, 2018 · 3 comments
Open

infinite loop when trying to convert JSONX with extra comma #2

skunkworker opened this issue Feb 7, 2018 · 3 comments
Labels

Comments

@skunkworker
Copy link

I was parsing a JSON document that had an extra comma, and when trying to clean it up it produced an infinite loop and threw a format error.

input = " {\"foo\":\"bar\",,}"
JSONX.convert(input)

throws

!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<
!! format error: object literal - expected colon (:) - rest is >>}<<
!! format error: string literal - expected opening quote (") - rest is >>}<<```
endlessly.
@geraldb
Copy link
Member

geraldb commented Feb 7, 2018

Thanks for trying and reporting. That's a bug.

@hadaromash
Copy link

Happens to me as well in SON.Parse for:
'{ "mock": "text",}'

@geraldb geraldb added the bug label Jan 29, 2020
@geraldb
Copy link
Member

geraldb commented Jan 29, 2020

Thanks for trying and reporting. That's a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants