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

Invalid JSON map parsed as OK #131

Open
edsiper opened this issue May 14, 2018 · 3 comments · May be fixed by #194 or #197
Open

Invalid JSON map parsed as OK #131

edsiper opened this issue May 14, 2018 · 3 comments · May be fixed by #194 or #197

Comments

@edsiper
Copy link

edsiper commented May 14, 2018

The following invalid JSON map is parsed without problems:

{"team":"test", "cpu":"10", {"log": "test"}}

I am using the strict mode but the problem persist. any suggestions are welcome:

cc: @zserge @lunatikub

@pt300
Copy link
Collaborator

pt300 commented May 15, 2018

After thonking for a moment I already see quite a simple solution for a problem. The thing is that I also see quite a bit of other parsing related problems. For example {"foo":::::::::::::::::::::::::::::::"bar"} will be parsed as valid JSON. And I'm wondering whether I should help make a bit of a code overhaul to improve validation or just submit small patches when problems like that get reported.

@edsiper
Copy link
Author

edsiper commented May 15, 2018

on top of my current JSMN I have applied PR #119 which adds more strict checks, so I see that a solution needs to be on top of that one.

JSMN is really great, it just need more strict checks

edsiper pushed a commit to fluent/fluent-bit that referenced this issue Jun 7, 2018
This patch also fixes the problem we previously reported
in the jsmn repo:

  zserge/jsmn#131

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
@edsiper
Copy link
Author

edsiper commented Jun 7, 2018

FYI: we applied a fix into our top level project:

fluent/fluent-bit#621

edsiper pushed a commit to fluent/fluent-bit that referenced this issue Jun 8, 2018
This patch also fixes the problem we previously reported
in the jsmn repo:

  zserge/jsmn#131

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
@dominickpastore dominickpastore linked a pull request May 25, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants