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

Parser pass invalid JSON when PARENT_LINKS is enabled #81

Closed
edsiper opened this issue Jun 21, 2016 · 8 comments
Closed

Parser pass invalid JSON when PARENT_LINKS is enabled #81

edsiper opened this issue Jun 21, 2016 · 8 comments

Comments

@edsiper
Copy link

edsiper commented Jun 21, 2016

jsmn parser pass the following wrong JSON message when JSMN_PARENT_LINKS is enabled:

test case

int main()
{
  int ret;
  char *json = "\"key 1\": 1234}";
  jsmntok_t *tokens;
  jsmn_parser parser;

  jsmn_init(&parser);

  tokens = calloc(32, sizeof(jsmntok_t));
  ret = jsmn_parse(&parser, json, strlen(json), tokens, 32);
  free(tokens);
  printf("ret=%i\n", ret);

  return 0;
}

With JSMN_PARENT_LINKS set, the parser returns 2, when disabled it returns -2 (expected).

edsiper added a commit to fluent/fluent-bit that referenced this issue Jun 21, 2016
this patch add support for raw JSON messages over the serial
interface, it can receive multiple messages and parse them upon
arrival time.

Note this implementation (as of this patch) is still under development
as there is some issues with lib/jsmn. A bad former JSON message
may generate incorrect messages. I have logged an issue here:

  zserge/jsmn#81

In order to enable JSON support the 'Format' property must to be set
with the 'json' value, e.g:

  [INPUT]
      Name serial
      ...
      Format json

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

edsiper commented Sep 20, 2016

any update on this ?

@pt300
Copy link
Collaborator

pt300 commented Oct 1, 2016

Problem seems to be around #ifdef on line 186.
Without JSMN_PARENT_LINKS function returns on line 218 which won't be executed with that define.

@pt300
Copy link
Collaborator

pt300 commented Oct 1, 2016

It would be nice if somebody could test that fix.

@zlolik
Copy link
Contributor

zlolik commented Oct 2, 2016

@pt300
I have added some tests and couple of them failed. zlolik/jsmn@a01d301

@pt300
Copy link
Collaborator

pt300 commented Oct 2, 2016

@zlolik I think you overdone these tests a bit. pt300/jsmn@c3131d0

@zlolik
Copy link
Contributor

zlolik commented Oct 3, 2016

@pt300 You are right, with JSMN_STRING is my fault. And other cases are more about general json stricting, maybe #52. With some playing I have found one more invalid json interpreted as valid with PARENT_LINKS:

js = "{\"key 1\": 5678}: 1234}";

And this one return different error with or without JSMN_STRICT - this may be a feature:

js = "{\"key 1\": { b1234 } : c4321}";

New tests are here: zlolik/jsmn@29c999c

@edsiper
Copy link
Author

edsiper commented Oct 11, 2016

thanks for reviewing this. After the latest changes, is it safe to use the current version in GIT master or is there anything pending ?

@pt300
Copy link
Collaborator

pt300 commented Oct 12, 2016

From what I know my pull request wasn't accepted so to benefit that fix you'd have to use my fork

@zserge zserge closed this as completed in ad72aac Oct 12, 2016
timurey added a commit to timurey/jsmn-extras that referenced this issue May 28, 2017
* commit '35086597a72d94d8393e6a90b96e553d714085bd':
  added travis badge
  added travis.yml
  strict checking fails a test, add {}s to fix it
  Fix issue in documentation.
  Changed unmatched bracket tests
  some tests for unmatched brackets added
  Seems to actually fix zserge#81
  Partialy fixes zserge#81 Still will report invalid amount if we fetch it with something like "{"key 1": 1234}}"
  Very minor changes to Makefile
  Very minor changes to C source code
  Fix typos
  tests: fix test_object JSMN_PRIMITIVE bug

# Conflicts:
#	README.md
#	jsmn.c
#	jsmn.h
ihsan314 added a commit to cloudlockr/cloudlockr-de1 that referenced this issue Mar 31, 2021
commit 053d3cd29200edb1bfd181d917d140c16c1f8834
Merge: a91022a 0837288
Author: P4t <pt300@tlen.pl>
Date:   Thu Apr 2 15:08:12 2020 +0200

    Merge pull request #175 from pks-t/pks/struct-type

    jsmn: declare struct names to allow forward decls

commit a91022a07d70674fc4b8c5e3f448f2bd93b00066
Author: Toni Uhlig <matzeton@googlemail.com>
Date:   Fri Mar 13 21:46:40 2020 +0100

    fix gcc/clang warning and unnecessary implicit type conversion to different size/signedness (#187)

    * fixed gcc/clang warnings regarding implicit numeric to enum type conversion

    * fixed unnecessary implicit type casts regarding size and signedness

    Co-authored-by: Toni Uhlig <Toni.Uhlig@rohde-schwarz.com>

commit 7b6858a5855299d173c5ab2b46e611bf9961cbef
Author: Alexey Radkov <alexey.radkov@gmail.com>
Date:   Wed Feb 19 17:32:48 2020 +0300

    Fixed a typo (value -> number) (#186)

commit 0837288b7c6dbd3c015f6a184cfa1e99937c5d09
Author: Patrick Steinhardt <ps@pks.im>
Date:   Fri Nov 8 16:52:31 2019 +0100

    jsmn: declare struct names to allow forward decls

    Both `jsmntok_t` and `jsmn_parser` are declared as anonymous structures
    that are typedeffed to their actual name. This forces all downstream
    users of jsmn to always use the typedef name, instead of using e.g.
    `struct jsmn_parser`. While this might be considered a matter of taste,
    using typedefs only has the technical downside of disallowing forward
    declarations. E.g. if a dependent whishes to declare a pointer to
    `jsmntok_t` without actually pulling in the "jsmn.h" header, then he is
    not able to do so because there is no way in C to provide a forward
    declaration for typedefs to anonymous structs.

    Fix this by providing names for both `jsmntok_t` and `jsmn_parser`
    structures.

commit 85695f3d5903b1cd5b4030efe50db3b4f5f3c928
Merge: fdcef3e cdcfaaf
Author: P4t <pt300@tlen.pl>
Date:   Sun Jul 14 19:01:49 2019 +0200

    Merge pull request #162 from ghane/Case-Warning

    Add default case for a switch statement to avoid complaints from the compiler.

commit cdcfaafa49ffe5661978292a55cec7fd459571e4
Author: Sanjeev Gupta <ghane0@gmail.com>
Date:   Sat Jul 13 22:01:56 2019 +0800

    Quieten a warning from the compiler

    gcc (and others) like a default case for switch statement,
    even if it is empty.

commit fdcef3ebf886fa210d14956d3c068a653e76a24e
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Apr 20 08:05:39 2019 +0200

    Modernize (#149)

    * add .clang-format for automated code formatting
    * automatic code formatting
    * move config.mk below all target to allow custom non-default build targets
    * add license to the top of the file
    * use correct header file guards syntax
    * convert to single-header, header-only library
    * update makefile to use jsmn as a header-only library
    * update readme
    * add changed from PR #143
    * fix clang warnings
    * add changes from PR #142
    * add consts as per PR #134

commit 18e9fe42cbfe21d65076f5c77ae2be379ad1270f
Merge: 732d283 614a36c
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Tue Oct 2 10:46:08 2018 +0200

    Merge pull request #139 from BenBE/patch-1

    Minor typo in jsmn.c

commit 614a36c18cd4865cffafc9089b0e024c6f67d649
Author: BenBE <BenBE@geshi.org>
Date:   Mon Oct 1 17:47:01 2018 +0200

    Typo in comment

    Fixes #84

commit 732d283ee9a2e5c34c52af0e044850576888ab09
Merge: 6784c82 f38f267
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Feb 12 09:40:59 2018 +0200

    Merge pull request #126 from abalkin/patch-1

    Fixed two typos in a comment.

commit f38f267b62cee4cde1d8e245ce6acc642cb2bf91
Author: Alexander Belopolsky <abalkin@users.noreply.github.com>
Date:   Sat Feb 10 19:22:23 2018 -0500

    Fixed two typos in a comment.

commit 6784c826d9674915a4d89649c6288e6aecb4110d
Merge: 3508659 f276e23
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Jan 25 22:49:10 2018 +0200

    Merge pull request #123 from drbitboy/btc/typos

    btc/typos - JSON_ERROR_... should be JSMN_ERROR_... in README.md

commit f276e23a74f6a2f4342cf2094d99d869408512e9
Author: Brian Carcich <brian.carcich@kinetx.com>
Date:   Thu Jan 25 15:38:16 2018 -0500

    btc/typos - JSON_ERROR_... should be JSMN_ERROR_... in README.md

commit 35086597a72d94d8393e6a90b96e553d714085bd
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon May 1 11:44:07 2017 +0300

    added travis badge

commit fe296583c010821db38748a5dc0eeb4a0a0ce8e1
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon May 1 11:42:48 2017 +0300

    added travis.yml

commit c772a0e48b9e0ce41de80743c99696880a7de4f3
Merge: 1682c32 6572217
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Sun Apr 30 22:43:06 2017 +0300

    Merge pull request #99 from prubel/strict-unmatched-brackets-test-fix

    strict checking fails a test, add {}s to fix it

commit 6572217a0e71fdc13c9ea5571203187f383665e0
Author: Paul Rubel <prubel@akamai.com>
Date:   Tue Dec 13 15:23:23 2016 -0500

    strict checking fails a test, add {}s to fix it

    The current test looks for success, but since there are
    no surrounding {}s the test fails. Add them in and add
    a test like the one that we replace but only in the
    non-strict code path.

commit 1682c32e9ae5990ddd0f0e907270a0f6dde5cbe9
Merge: 0f574ea c3131d0
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Wed Oct 12 17:09:07 2016 +0800

    Merge pull request #94 from pt300/master

    Fix for no error with unmatched closing bracket with PARENT_LINKS

commit 0f574ea35becadb10f302795a5ffbc0b8bda8934
Merge: 6021415 f40811c
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Oct 6 17:38:02 2016 +0800

    Merge pull request #95 from crondaemon/doc-fix

    Fix issue in documentation.

commit f40811c4ded512135cdf18494ade5e706f01cb6e
Author: Dario Lombardo <lomato@gmail.com>
Date:   Thu Oct 6 10:29:35 2016 +0200

    Fix issue in documentation.

commit c3131d05a6db72c1ddefb1ad4c95ddbc604d1fa6
Author: pt300 <pt300@tlen.pl>
Date:   Sun Oct 2 10:37:29 2016 +0200

    Changed unmatched bracket tests

commit adae9457cfac9f8b9eae2055af197109ddd563f1
Merge: 4ce4404 a01d301
Author: Pat <pt300@tlen.pl>
Date:   Sun Oct 2 09:48:27 2016 +0200

    Merge pull request #1 from zlolik/master

    some tests for unmatched brackets added

commit a01d301373595892e2e5ff77dd4e7715f7897f11
Author: zlolik <lolikandr@gmail.com>
Date:   Sun Oct 2 07:51:52 2016 +0300

    some tests for unmatched brackets added

commit 4ce44040579e65755d14a3d7dabdae0913959a24
Author: pt300 <pt300@tlen.pl>
Date:   Sat Oct 1 18:19:20 2016 +0200

    Seems to actually fix zserge/jsmn#81

commit ad72aac67ab84280cbd7e08b2668ef7fe5db046e
Author: pt300 <pt300@tlen.pl>
Date:   Sat Oct 1 18:07:35 2016 +0200

    Partialy fixes zserge/jsmn#81
    Still will report invalid amount if we fetch it with something like "{"key 1": 1234}}"

commit 6021415cc75e7922d45b12935f56348b064d8a7f
Merge: 452c926 b80578c
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Wed Aug 10 10:40:39 2016 +0800

    Merge pull request #87 from RyDroid/make

    Very minor changes to Makefile

commit 452c926709f130e0364ce02dc19a49956396baae
Merge: d1c85c5 e42bcbb
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Wed Aug 10 10:40:26 2016 +0800

    Merge pull request #88 from RyDroid/minor-c

    Very minor changes to C source code

commit b80578ce0893f67e60c5daffa9b5d21a7c978cef
Author: Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
Date:   Mon Aug 8 16:05:12 2016 +0200

    Very minor changes to Makefile

commit e42bcbbada01199e00be7576fd2fda69f04b8bd7
Author: Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
Date:   Mon Aug 8 15:54:56 2016 +0200

    Very minor changes to C source code

commit d1c85c569d11b8f014858982d5744b5139c52cc1
Merge: bbc6755 37672b0
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jun 13 01:12:23 2016 -0500

    Merge pull request #79 from ferambot/master

    Minor fixes

commit 37672b0289b076de40b888042e629ed794663ee9
Author: Feram <feram@feram.co>
Date:   Mon Jun 13 06:10:46 2016 +0000

    Fix typos

commit bbc6755fce14c713f9bb4ba47c688d15efc1394b
Merge: b77d84b e3f2629
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Apr 2 03:10:43 2016 -0500

    Merge pull request #76 from simonsj/master

    tests: fix test_object JSMN_PRIMITIVE bug

commit e3f2629a562c260fc3fe3d69576cd7b06f3a3760
Author: Jon Simons <jon@jonsimons.org>
Date:   Fri Apr 1 19:59:14 2016 -0700

    tests: fix test_object JSMN_PRIMITIVE bug

    Specify the argument after JSMN_PRIMITIVE as "0" instead of 0 so
    that weird things don't happen on OSX due to using it later with
    `va_arg(..., char *)` in `vtokeq`.

commit b77d84ba48e057aa464b6c6b6f6209e632918cb3
Merge: 572ace5 76c9448
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Mar 28 06:10:47 2016 -0500

    Merge pull request #75 from condemned77/master

    Typo fix.

commit 76c9448ca8aceb7edeff63506708b9d272440a05
Author: condemned77 <michael.jaeg@gmail.com>
Date:   Mon Mar 28 12:28:36 2016 +0200

    Typo fix.

    Minor typo fixed.

commit 572ace5a43c43b1c6dc55f31fab03718faf2f647
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Wed Jan 20 17:28:15 2016 +0800

    Update README.md

commit 09843be91240b8200568609819fbf308622d18f1
Merge: 78b1dca 86d5957
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Tue Jan 19 23:00:50 2016 +0800

    Merge pull request #66 from ivankravets/patch-1

    @platformio Library Registry manifest file

commit 86d595729cd0e1d2dd82f3fa1da6443c6b212c59
Author: Ivan Kravets <me@ikravets.com>
Date:   Tue Jan 19 16:34:12 2016 +0200

    @platformio Library Registry manifest file

    * This library in Web Registry: http://platformio.org/#!/lib/show/568/jsmn
    * Specification: [library.json](http://docs.platformio.org/en/latest/librarymanager/config.html)
    * Library Manager:  http://docs.platformio.org/en/latest/librarymanager/index.html

commit 78b1dca33423fe1a2912fab1e815d785cd36af95
Merge: 4a54ae6 b7845b4
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Wed Jan 13 19:20:44 2016 +0800

    Merge pull request #65 from Smattr/02ab7ac3-79ee-4541-a80a-230e2ceae1dd

    Fix trivial comment typo.

commit b7845b4ea43b71829e802982235c9988960a589d
Author: Matthew Fernandez <matthew.fernandez@nicta.com.au>
Date:   Wed Jan 13 21:45:00 2016 +1100

    Fix trivial comment typo.

commit 4a54ae6987a37ca3734ac1e9ab6b7f1f44e2712d
Merge: fdceddf e4d526a
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Dec 14 23:04:37 2015 +0800

    Merge pull request #62 from baskerville/master

    Fix deheader warnings

commit e4d526a4033c4548dc3f9ade2ec14ff87b9455ea
Author: Bastien Dejean <nihilhill@gmail.com>
Date:   Mon Dec 14 15:05:46 2015 +0100

    Fix deheader warnings

    Prior to this commit the output of deheader was:
    	remove <stdlib.h> from ./jsmn.c
    	in ./example/jsondump.c, realloc() portability requires <unistd.h>.
    	in ./example/simple.c, strtol() portability requires <stdlib.h>.
    	saw 4 files, 16 includes, 1 removable

commit fdceddf6854af498e192427d70bcc9c2e98a1729
Merge: 8da639a 6bfa208
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Tue Dec 8 08:34:46 2015 +0800

    Merge pull request #61 from elelay/master

    fix jsmntype_t definition in README

commit 6bfa20872c82bab2e1f7824348081b2e9cd4d4b8
Author: Eric Le Lay <elelay@macports.org>
Date:   Mon Dec 7 20:14:07 2015 +0100

    fix jsmntype_t definition in README

commit 8da639a33468125dad9bcfe25ee8065e321c849c
Merge: 076abdd f06a10c
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Nov 19 17:04:51 2015 +0800

    Merge pull request #60 from baskerville/master

    Fix typo

commit f06a10c1b7b58784d20d2b06bf24b78cacf3fb83
Author: Bastien Dejean <nihilhill@gmail.com>
Date:   Thu Nov 19 09:55:46 2015 +0100

    Fix typo

commit 076abddc19f844b98e5ee591eae8d8a9a34c2c19
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 31 18:43:04 2015 +0200

    fixed privitive value typo in tests

commit 7fb89f1eb23a2a62d54fd5c3b9c44243828ecfd4
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 31 18:37:25 2015 +0200

    initialized ok variable in tests, parse should still return 1 if expected result is a failure

commit 8a5ee3d41b17a600effe0c994beac093ca836118
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 31 18:33:43 2015 +0200

    fixed a typo in the test name

commit 2db03781c59bd59cbb9269d6e5793b884c788816
Merge: 0c2d60b 2d185aa
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Sun Oct 25 22:42:48 2015 +0200

    Merge pull request #55 from goriy/example_realloc_fix

    small fix of jsondump example for cases of realloc failures

commit 2d185aa465782ba30bfaea5ccd39cea4917e69a8
Author: goriy <goriy@users.noreply.github.com>
Date:   Sun Oct 25 23:28:19 2015 +0300

    tiny realloc function wrapper which handles cases of realloc failures

    Memory reallocation with old data pointer handling is done by means
    of realloc_it() function.

    Tiny inline function realloc_it() is a wrapper function for standart
    realloc() which frees old memory pointer and prints errno to stderr
    if realloc fails.

commit e709651a20f3b32c5cca9e3ca29c6b0b43bbb4d8
Author: goriy <goriy@users.noreply.github.com>
Date:   Sat Oct 24 23:32:51 2015 +0300

    small fix of jsondump example for cases of realloc failures

    When realloc() function fails it returns NULL pointer.
    But old data pointer remains valid in such a case.

    It's a mistake to use old data pointer to store new
    pointer returned by realloc. In case of realloc failure,
    pointer is overwritten with NULL value, but old used memory
    remains unreferenced and could not be even freed anymore.
    Such mistakes could lead to memory leaks.

commit 0c2d60b8e7820857fe14dfd113a90c94b2f18611
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:25:44 2015 +0200

    added and marked as fixme tests for false positives in objects

commit f7e6dcb7a2296386f251417e3fc259ef43abb41c
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:24:44 2015 +0200

    added another test of invalid array

commit e5fb875b593447c33accaf3572c5b7bc662829d7
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:19:01 2015 +0200

    added another test of invalid array

commit aedc121ce8a5ef0156ee6cb7e06fcd96457220a0
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:14:13 2015 +0200

    added check for null pointer before fixing tokens after parsing is done

commit 824d9a769c38584c5aef9f6f12642645c66dc055
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:09:35 2015 +0200

    applied fix from wireshark

commit d0664f9a2ee942e0edaa255309f67b3f77e04b50
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:06:39 2015 +0200

    changed jsmnerr_t type to int

commit 5e37daeec3cb49dc34a9377d3d2230c0394d1f3c
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 15:01:01 2015 +0200

    added issue 27 test case

commit edd751896de5de1fcee95cb65949e6784c726751
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 14:58:47 2015 +0200

    fixed return value on incremental parting

commit 9b4e33199f16fe0dd764db3622ab772e4764e0e0
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 14:58:31 2015 +0200

    moved tests into a subfolder, added table-driven tests

commit 226f318224e772edf3109da3af1d283e6dee3d57
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 10:50:22 2015 +0200

    json token type enum doesn't start with zero value anymore, fixes #24

commit d87c22d2cd38bb4065d2b33cb683792c2dc9eed3
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 10:42:30 2015 +0200

    removed mixed declarations and code, fixes #45

commit 6809c029aa0f194bb7bb03a9e2fe70e729bf209b
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 10:39:27 2015 +0200

    changed test function args to void, fixes #46

commit 6cb9c3721dfd7fab2bd63df9683b6fed67f86212
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sat Oct 17 10:29:54 2015 +0200

    test exit status depends on number of failed tests

commit bd9bd55c3a79a1f1f24d1bbf1c4a12e40a4810c8
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Sep 24 18:22:14 2015 +0200

    Changed links to github

commit 26193d39c2d17bf184b691ebfa406b5b9782577a
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Fri Dec 19 01:40:26 2014 +0200

    updated README

commit cf38b7d17157ba674199238da776d822b184c154
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 16:21:36 2014 +0200

    added js string boundaries checks for string parser, fixes issue #31; added tests to cover it; fixed makefile to use custom cflags/ldflags

commit 91d7389ec80c742a589bfed25e62aa5f95d2f0f9
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 15:36:18 2014 +0200

    added some tests for key/values nodes and added some stricter validations

commit 946a2b1e02665a6c0235ba26c432cf09fe598cce
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 15:06:12 2014 +0200

    moved i declaration to the top of the block, issue #38 fixed

commit a0e2b876cacf1dae415dd331e0589b1832ae2052
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 14:28:27 2014 +0200

    including stddef.h in the jsmn.h, fixed issue #28

commit 838061aa96bf9a756b3ae744787064b3201da914
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 14:14:45 2014 +0200

    removed trailing spaces

commit 8a22e0a14900dfcc4cdcfc71d5e12acff561ce25
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Nov 17 14:13:58 2014 +0200

    implemented key/value hierarchy; added 2 examples; fixed some warnings in tests

commit e0847b52b5cec05ce91c99c9ed09d1abf81a0a7f
Merge: 76cd398 cf39341
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Oct 9 19:49:10 2014 +0300

    Merged in setekhid/jsmn/setekhid/jsmnh2822-warning-commas-at-the-end-of-e-1408807731663 (pull request #11)

    jsmn.h:28:22: warning: commas at the end of enumerator lists are a C99-specific feature [-Wc99-extensions]

commit cf39341a39938e304cf0f2371ac97ea4c48da973
Author: Wizard Tai <geb.1989@gmail.com>
Date:   Sat Aug 23 15:28:58 2014 +0000

    jsmn.h:28:22: warning: commas at the end of enumerator lists are a C99-specific feature [-Wc99-extensions]

    WITH:

    -std=c89 -Wall -pedantic -Wno-declaration-after-statement

commit 76cd398859b868988d3ab0d663d9ba7c8b35e9d9
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Fri Feb 21 11:04:16 2014 +0200

    removed JSMN_SUCCESS value from the readme

commit f2864e69b90e7f80b37c04c562b99b222b591235
Merge: 5faee05 db379ec
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Fri Feb 21 11:03:29 2014 +0200

    Merged in MacGritsch/jsmn-patch (pull request #7)

    Added "extern C" to use it with CPP.

commit db379ec1248ff8a24c3bb330d46e73898ff3adc6
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Fri Feb 21 09:53:45 2014 +0100

    Added "extern C" to use it with CPP.

commit a89501b2fbc4fa30b0653328931cf7d9162851e6
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Fri Feb 21 09:52:23 2014 +0100

    Integrate changes made by Serge Zaitsev.

commit 5faee057cb4f75fcb72a57e628cf697bf0467c85
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Fri Feb 21 00:24:29 2014 +0200

    edited readme about what's inside the repo. closes issue #19

commit f0ae25f873ca13cf798a7381d9ea4c5d51db3a79
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Fri Feb 21 00:11:52 2014 +0200

    added way to specify json string length, added test for non-strict mode

commit 809c7c6db1fd8691db78900b952f94150e7d98c9
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Thu Feb 20 22:27:07 2014 +0200

    added way to estimate number of tokens before parsing

commit 733b8e958e64196b5f440fe5d631e45c7445a094
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Sun Feb 16 10:54:19 2014 +0100

    Changes for SIZE_MAX

commit c91adcedede3392e910bd5befbe4ec24ad136db7
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Sun Feb 16 10:45:20 2014 +0100

    - Added possibility to specify the lenght of the input buffer (if not null-terminated).
    - Added "extern C" to use it with CPP.

commit 659842c65c58724673fcc8a3ff7bd9408e5804f9
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Sun Feb 16 10:42:27 2014 +0100

    - Added possibility to specify the lenght of the input buffer (if not null-terminated).
    - Added "extern C" to use it with CPP.

commit 385b42e740fd8e040057ba682e402a208f211db7
Author: Gabriel Gritsch <gabriel@gritsch-soft.com>
Date:   Wed Feb 12 17:53:45 2014 +0100

    - Added possibility to specify the lenght of the input buffer (if not null-terminated).
    - Added "extern C" to use it with CPP.

commit 86350f2bb1681c573abd44018ee49883989008dd
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sun Feb 9 17:09:15 2014 +0200

    a proper fix for signed comparison

commit da959780339c33ebe0c3d0f86351a9734d6eb08b
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Sun Feb 9 17:04:39 2014 +0200

    added cast size_t to int to avoid warnings, removed string.h header since it was merged by accident

commit d0ca2df480f016936de58c03d59ab45ebc259f84
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jan 27 17:11:54 2014 +0200

    fixed jsmntype_t definition

commit c29d151bfac8656c693fa5843279ff2273aa7381
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jan 27 16:04:43 2014 +0200

    added link to the web page

commit 2b0e4464c7d921a80b8053d305995a465d4d67df
Merge: 323395e e397f0d
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jan 27 16:09:33 2014 +0200

    Merged in frnknstn/jsmn/markdown (pull request #5)

    rename README so markdown renders in source control

commit 323395efac30a5c4bfb09aff1cfac9168d2627c2
Merge: 40392b7 ee10da0
Author: Serge Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jan 27 16:08:19 2014 +0200

    Merged in frnknstn/jsmn/clean (pull request #4)

    delete jsmn_test.exe when doing make clean

commit 40392b73e3f3048e10f1338f7ab9b5e47a8aa08e
Author: Serge A. Zaitsev <zaitsev.serge@gmail.com>
Date:   Mon Jan 27 15:58:43 2014 +0200

    fixed indentation and comments style after merge

commit e397f0dfb652b39dd4d9f753d11035cf2bc0b7b2
Author: Peter Finlayson <frnknstn@iafrica.com>
Date:   Mon Dec 23 12:39:00 2013 +0200

    rename README so markdown renders in source control

    The readme file is in markdown, but most source control systems and repos (including bitbucket) expect a markdown readme to be called README.md

commit ee10da0f1e97b12126596a8c436aacb8ad62c832
Author: Peter Finlayson <frnknstn@iafrica.com>
Date:   Mon Dec 23 12:29:33 2013 +0200

    delete jsmn_test.exe when doing make clean

    When building the jsmn test suite on Windows via mingw, the output executable is called "jsmn_test.exe" instead of just "jsmn_test".

commit 07af5df94bd672ffd57428fc615c784e580b9fba
Merge: f190d18 6f4e2f7
Author: del6597 <devnull@localhost>
Date:   Fri Jul 19 00:23:58 2013 -0400

    Removes the incorrect counting of tokens

commit f190d18a52e232125bcec9920df1cb171330078b
Author: del6597 <devnull@localhost>
Date:   Fri Jul 19 00:15:49 2013 -0400

    Adds checking to unicode characters that are \uXXXX where X is a hexidecimal digit
    Adds new tests for unicode character coverage

commit 6f4e2f7a565fb779159a299efe6e1e5110c2f1a6
Author: del6597 <devnull@localhost>
Date:   Wed Jul 17 00:05:47 2013 -0400

    Added a method for jsmn_estimate_tokens(const char *json);

commit 958c758f2e9eb501679ab3bd6cda7d14421e84f4
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Oct 22 21:54:46 2012 +0300

    fixed: invalid object/arrays were passed successfully in tree mode; added tests for this case

commit 3d6fb06ee9636902380856ad3656cb0504b0fff3
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Oct 1 12:43:37 2012 +0300

    fixed typo

commit cf172e71d7d8802cccf0fb8369280c6e1aae89a2
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Oct 1 11:15:48 2012 +0300

    fixed tests: missing jsmn_init() before parsing; added tests for empty arrays/objects

commit e0ceee893c86f7f727bd05aa0e96a716983b610a
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Sep 26 20:28:12 2012 +0300

    fixed strict mode: space symbols are allowed after primitives; added some new tests

commit 37964b40ee94fdfdc9a8408a9ade9d7f3cb94683
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Sep 26 20:19:21 2012 +0300

    added optional parent token pointer support. Increases parsing speed

commit cfbb5b509174552ed00ac0ad46d474d00cad6e9d
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Sun Sep 23 20:30:56 2012 +0300

    removed unused variable

commit 974133db8531c7edd9969c8ebb04470318fc767d
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Sun Sep 23 20:29:48 2012 +0300

    tokens array items are now being initialized during allocation, removed redundant code that significantly slowed down the parser

commit e542dea54ef194c36d5815bfe18a1b7e0615d02b
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Sep 3 19:54:40 2012 +0300

    changed return value to jsmnerr_t, fixed warning about signed/unsigned values

commit af04595fe243554ee762f515c088f99ce26e2b27
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Thu Feb 2 14:05:47 2012 +0200

    fix: error is returned if brackets are unmatched

commit f3b41ae30c7627f540ee539aed51bcca06d23a82
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Thu Feb 2 13:26:15 2012 +0200

    fixed: superior node size is now an index, not a pointer (safe to realloc)

commit a983a7606136a3dfd538a9940c5ebf48d200251c
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Thu Feb 2 13:15:22 2012 +0200

    added reading with small number of tokens test, fixed NOMEM issue #2

commit 53454e542929d07b6fea438fd112eed2f7d865b4
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Thu Feb 2 11:40:36 2012 +0200

    added test for partial array reading

commit 41171ecd5129abf2b6a933c2cb81e6795963f1a3
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 17:51:42 2012 +0200

    fixed typo, added JSMN_STRICT mode

commit e395ad562e83e6db07b88cb595cb676f6ffe8420
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 17:18:32 2012 +0200

    added one more test case for partial string parser

commit 30f932772ecd749f43b9e9fda18626d3895e4c1c
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 17:15:54 2012 +0200

    tested partial parser for strings, added primitive string parser test, fixed token allocation

commit 929e2337562c21d17b4ee31b1db90ccf0fa09d8d
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 16:03:36 2012 +0200

    added tests for primitive types, primitive types now can be stored outside the objects without braces

commit 443be365f6bf8639a1b1e836e8e948d12af28100
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 14:02:12 2012 +0200

    removed JSON string and token array from parser internals, because they must not be saved between parse() calls

commit bed0a7a3e647abb7204d73c69f9f44b37bdfc84f
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 13:56:06 2012 +0200

    changed API: parse now is more flexible, but init jsut resets the parser; added new test macro to compate strings, fixed Makefile

commit 4b5c5ed66ac35f50b6c172a712883acb5f0cc62f
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 12:38:51 2012 +0200

    switched to C unit-tests instead of bash

commit 2928f7ec0ebcd6ae9937a5689d8da2369c863f69
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Feb 1 12:38:05 2012 +0200

    renamed: get_token to alloc_token

commit 0c22b772ed03ff960c2e052b2422a28b855b0927
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Jan 30 14:03:36 2012 +0200

    using system AR program, build options are moved to config.mk

commit d6209011a5ff65c4ea0e135ddef5e54e40edfa56
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Thu Sep 15 18:43:48 2011 +0300

    added download links in README

commit d6f48a6a3d11bd2acc23897674a9ab4a36ecb50b
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Mar 28 13:32:44 2011 +0300

    fixed: issue #1, thanks to m_einman for his patch

commit 42be9208f75cec544346c430e8811b359048e639
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Dec 28 12:06:52 2010 +0200

    README updated

commit 4e869f7e9e3121ee84b8a3b65806143f7c8672ab
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Dec 28 11:16:41 2010 +0200

    Complex types (objects and arrays) now have also size - number of child elements

commit c4d9412483bc561cef53a784e9f28b827e010e7b
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Dec 27 17:05:22 2010 +0200

    Some comments added in json.c

commit c955364a952c5ad5158637b77c75edcf010d49af
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Dec 27 17:00:24 2010 +0200

    All objects renamed using jsmn prefix to keep consistency and not be mixed with other json libraries. Demo is now called just demo.

commit 4e29ee705f1db5cf2cfed613439a5e8b377f06d9
Author: Serge Zaitsev <devnull@localhost>
Date:   Sun Dec 26 13:48:13 2010 +0200

    Fix: check if no tokens lefs, return error in that case

commit 99247345750f32468ce163e3c8a0ac39b52c65f0
Author: Serge Zaitsev <devnull@localhost>
Date:   Sun Dec 26 13:02:40 2010 +0200

    Typo in tests fixed. Argument variable quoted

commit 3d94cd0a184fbb319180a579323900289b29cc08
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 29 13:53:13 2010 +0200

    Removed useless argument from printf

commit 2cf5193d64e2b807584f05a698c1338516576991
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 29 13:52:11 2010 +0200

    README changed. Now it is a template for the official web page

commit 978ea959f41bf9653689fc3566e68bc4fc59785d
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 24 11:15:21 2010 +0200

    Added test for a large number of tokens

commit 508bf43fa001486025b5be6fbdc3d943e3d56ac4
Author: Serge Zaitsev <devnull@localhost>
Date:   Wed Nov 24 00:54:21 2010 +0200

    Test framework implemented

commit f88240ac2e081b94454203a2d8595b8598a037b3
Author: Serge Zaitsev <devnull@localhost>
Date:   Wed Nov 24 00:26:15 2010 +0200

    Simplified demo output format

commit 23b8487783f1fcabc164db71a9e1f5388ecb6daa
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 22 14:52:46 2010 +0200

    Demo: option added to specify buffer size when reading

commit 8e31e4d2148febcee4ee371eadcab06aa21b83e3
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 22 14:52:26 2010 +0200

    jsmn: strings start from the first char after quotes

commit b91dee9102c090cf7fffa089af48794e5c727c69
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 17 17:33:29 2010 +0200

    Demo: declarations moved to the top of functions.

commit 7a027a4dd2191a112ea0cc2e48ae56b36e0f385e
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 17 15:16:12 2010 +0200

    Token manipulation functions changes. size_t replaced with unsigned int.

commit 3922360800a704d81a33b20ab1c3c48f9bd837a2
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 17 12:19:38 2010 +0200

    Demo: options added. Number of tokens can be specified now.

commit 991ca5dd940ab9f1deb492b3c8cec4692c2f7099
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 17 12:05:29 2010 +0200

    Demo: can now read from stdin

commit d0d52f68478f5cf6cb19629968dfe07c3ca040a7
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Wed Nov 17 12:03:26 2010 +0200

    Design: primitive type implemented as a replacement to boolean/number/null. String tokens point to the unquoted string

commit 60509e2850a1f4ac8324acc282bc307378d4980d
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Nov 16 15:41:49 2010 +0200

    Design: rewritten using parser structure

commit a2755a75953e61fffb6210c16ddbaee1e4f6ff90
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Nov 16 13:50:13 2010 +0200

    Design: some error codes added

commit daf93a0ebd10e3778ec77a62577543fb11884c83
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Nov 16 11:56:08 2010 +0200

    Feature: make difference between numbers and other primitives

commit 470c77fa6370bc765310638cf56256aacf963846
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Nov 16 11:53:43 2010 +0200

    Design: added assert macro and return macro.

commit 30370e37f879a0871ccbc078f8d3c86938b3a063
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Tue Nov 16 11:45:10 2010 +0200

    Design: Added asserts in parser. Increased number of tokens in demo.

commit b99663079c1542e514f0ca8056cd87cb3683bd7e
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 17:59:51 2010 +0200

    Fix: errpos has got a correct type now

commit b0e73ec44dc2693b6be327c01b905193f153df4c
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 17:58:50 2010 +0200

    Design: objects and arrays are different types now

commit a70dab5cf97ba4f23b0d1582948a607cbae713fa
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 17:39:25 2010 +0200

    Design: unrolled reference tables. Nested functions moved outside. Got smaller code.

commit aa97d8b59960ff007632ac5a6a6993a46935092e
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 15:46:31 2010 +0200

    Demo: changed to read from '.js' file

commit a20a5aff1c300ba3784fff5ab284dac8caf9475a
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 15:02:35 2010 +0200

    Fix: error position is an offset, not a pointer

commit 0568be6e0b1304226ddf8b17f3df4a5dfa2babdd
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 15:00:42 2010 +0200

    Demo separated from the jsmn code. Makefile changed. Some comments added

commit 6b6b3ba5c1148a08a852d2b221270f1c29bfb166
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 13:27:14 2010 +0200

    README and LICENSE added. MIT license choosen.

commit f22c2d30b7c73ebf1a7815b4a3eb5df18c251ed1
Author: Serge A. Zaitsev <devnull@localhost>
Date:   Mon Nov 15 13:11:08 2010 +0200

    Initial commit. Demo program is included in the jsmn.c code. Ugly names and no comments. Please, don't read this changeset
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

3 participants