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 parsing for Infinity with json-c 0.12 #371

Closed
jlguardi opened this issue Nov 3, 2017 · 1 comment
Closed

Invalid parsing for Infinity with json-c 0.12 #371

jlguardi opened this issue Nov 3, 2017 · 1 comment

Comments

@jlguardi
Copy link

jlguardi commented Nov 3, 2017

I've tested with json-c 0.12 and also with master code.

I've reduced the issue to this simple main.c:

#include <stdio.h>
#include <json-c/json.h>

int main(int n, char** v){
  char *str= "{ \"min\": Infinity, \"max\": -Infinity}";
  printf("%s\n", str);
  fprintf(stderr, "%p\n", json_tokener_parse(str));
  return 0;
}

json_tokener_parse doesn't parse correctly the second Infinity.

jlguardi pushed a commit to jlguardi/json-c that referenced this issue Nov 3, 2017
hawicz added a commit that referenced this issue Nov 27, 2017
…ent location than PR#372 used), and add a case to test_parse to check for this.
@hawicz
Copy link
Member

hawicz commented Nov 27, 2017

Fixed on both branches.

@hawicz hawicz closed this as completed Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants