Commit Graph

904 Commits

Author SHA1 Message Date
Max Bruckner 08738673be Reorder the context fields 2018-03-25 23:32:03 +02:00
Max Bruckner 1b001ab047 parse: Pull length calculation out. 2018-03-25 23:32:03 +02:00
Max Bruckner 409c2aaea7 cJSON_MakeDuplicateRecursive 2018-03-25 23:32:03 +02:00
Max Bruckner e8f56bd194 Context: Add duplicate_recursive for cJSON_Duplicate 2018-03-25 23:32:03 +02:00
Max Bruckner 064eec8208 Change name from Configuration to Context 2018-03-25 23:32:03 +02:00
Max Bruckner 050f982608 cJSON_DuplicateConfiguration 2018-03-25 23:32:03 +02:00
Max Bruckner d2d19127d3 cJSON_ConfigurationChangeParseEnd -> cJSON_ConfigurationGetParseEnd
This is probably a better approach than potentially having a pointer
that points to garbage on the stack and gets written to by cJSON.
2018-03-25 23:32:03 +02:00
Max Bruckner 691a83a479 cJSON_CreateConfig: Don't allow configuration, always use default 2018-03-25 23:32:03 +02:00
Max Bruckner ae9dc3e7db cJSON_ConfigurationChangeAllowDataAfterJson 2018-03-25 23:32:03 +02:00
Max Bruckner eeaaaac63e cJSON_ConfigurationChangeCaseSensitivity 2018-03-25 23:32:03 +02:00
Max Bruckner 78b5bed9a0 cJSON_ConfigurationChangeFormat 2018-03-25 23:32:03 +02:00
Max Bruckner 1a8f732749 cJSON_ConfigurationChangePrebufferSize 2018-03-25 23:32:03 +02:00
Max Bruckner 88c39fa2e4 cJSON_ConfigurationChangeParseEnd
Add a pointer to an end position of parsing to the cJSON_Configuration
object. (Essentially like return_parse_end, but as offset instead of
pointer).
2018-03-25 23:32:03 +02:00
Max Bruckner 9d801d64ea cJSON_CreateConfiguration, cJSON_ConfigurationChange{Allocators,Userdata} 2018-03-25 23:32:03 +02:00
Max Bruckner 877fac0f90 allocation helpers for allocating with a configuration 2018-03-25 23:32:03 +02:00
Max Bruckner 98e0b586ca Add cJSON_Allocators new style allocator struct 2018-03-25 23:32:03 +02:00
Max Bruckner dd1ba72ce2 cJSON_Compare: Extract compare with internal_configuration 2018-03-25 23:32:03 +02:00
Max Bruckner 515d11f55a default_configuration: Macro for the internal_configuration defaults 2018-03-25 23:32:03 +02:00
Max Bruckner ba8fe0f479 internal_configuration: Add case_sensitive 2018-03-25 23:32:03 +02:00
Max Bruckner f02f79ecbb cJSON_ParseWithOpts: Extract pasrse with internal_configuration
Also introduces a allow_data_after_json property in the internal
configuration.
2018-03-25 23:32:03 +02:00
Max Bruckner d4e81cfe57 cJSON_Delete: Extract delete_item with internal_configuration 2018-03-25 23:32:03 +02:00
Max Bruckner 7030dc7c5b Put buffer_size into internal_configuration 2018-03-25 23:32:03 +02:00
Max Bruckner 27977adc93 Put format into internal_configuration 2018-03-25 23:32:03 +02:00
Max Bruckner 677f0cb1bb Rename internal_hooks -> internal_configuration, cJSON_New_item -> create_item 2018-03-25 23:32:03 +02:00
Max Bruckner 3ebc06196a Gitignore: add CLion files 2018-03-25 23:31:36 +02:00
Max Bruckner fd5281bdd8 cJSON: cjson_min: Wrap arguments in parentheses 2018-03-25 15:12:15 +02:00
Max Bruckner 1f4044a707 cJSON.c: Remove unused cast 2018-03-25 15:11:56 +02:00
Max Bruckner 08a2ad3c59 is_{nan,infinity}: Wrap macro arguments in parentheses 2018-03-25 14:25:46 +02:00
Max Bruckner b06fb10f94 cJSON.c: Remove unnecessary includes 2018-03-25 14:20:48 +02:00
Max Bruckner ce5f31ac47 Remove superfluous null checks in can_read/access_at_index macros 2018-03-25 13:01:49 +02:00
Max Bruckner 0715259635 cJSON_Compare: Performance improvement for objects
Check the size to prevent comparing objects equal if they are prefixes
of each other.
2018-03-25 13:01:10 +02:00
Max Bruckner f4cc4d7c63 parse_value: Check only first character at first
This should improve performance
2018-03-25 13:01:10 +02:00
Max Bruckner 952b1017ab print_number: Introduce fast path for integers.
Thanks @Tangerino for suggesting this optimisation.
2018-03-25 13:01:10 +02:00
Max Bruckner 0914640d79 Extract helper: double_to_saturated_integer 2018-03-25 13:01:10 +02:00
Max Bruckner 5ed383a0d1 is_nan and is_infinity macros 2018-03-25 13:01:06 +02:00
Max Bruckner 3e2c29528a CMake: Remove -fsanitize=float-divide-by-zero
This is so that NaN and INFINITY values can be produced.
2018-03-25 13:00:12 +02:00
Max Bruckner b2bbc11d44 Fix #234: Different argument names between declaration and definition 2018-03-25 13:00:12 +02:00
Max Bruckner 06f4152008 print: Comment about why the buffer is reallocated 2018-03-25 13:00:12 +02:00
Max Bruckner 0e0c463491 Release version 1.7.5 2018-03-22 20:29:17 +01:00
Max Bruckner 2336a0348d Contributors: Add Bob Kocisko 2018-03-22 20:28:54 +01:00
Max Bruckner 5d50f4efe1 Contributors: Thank all the non-code contributors 2018-03-22 20:28:30 +01:00
Max Bruckner 8abf110750
Merge pull request #251 from bobkocisko/master
json patch: adding to a subfield of a non-object now fails as expected
2018-03-22 20:00:24 +01:00
Bob Kocisko d26a42af8d json patch: adding to a subfield of a non-object now fails as expected 2018-03-22 11:10:29 -04:00
Max Bruckner 6f264b5d0c
Merge pull request #249 from DaveGamble/fix-add-item
Release 1.7.4
2018-03-02 20:04:29 +01:00
Max Bruckner 5da9edc8b1 Release version 1.7.4 2018-03-02 19:57:36 +01:00
Max Bruckner 22a7d04fa0 add_item_to_object: Fix use-after-free when string is aliased
If the `string` property of the item that is added is an alias to the
`string` parameter of `add_item_to_object`, and `constant` is false,
`cJSON_strdup` would access the string after it has been freed.

Thanks @hhallen for reporting this in #248.
2018-03-02 19:49:55 +01:00
Max Bruckner a559eac472 Release version 1.7.3 2018-02-07 21:16:35 +01:00
Max Bruckner d514bb866e Fix #241, potential double free 2018-02-07 19:36:59 +01:00
Max Bruckner 27caa364b0 Release version 1.7.2 2018-02-06 11:38:41 +01:00
Max Bruckner f47271f455 Fix pkgconfig and installation. Thanks @zeerd for reporting
CMAKE_INSTALL_FULL_... needs to be used.
2018-02-06 11:24:03 +01:00