Commit Graph

143 Commits

Author SHA1 Message Date
mongobaba
2f6fc7f0f2
fix several null pointer problems on allocation failure (#526) 2020-11-12 11:46:15 +08:00
Alanscut
1fc755ac09 array's item should be in the list 2020-05-06 17:18:42 +08:00
Alan Wang
23e4fbc639
Merge pull request #454 from Alanscut/float-compare
comparing double value with DBL_EPSILON
2020-04-02 20:09:42 +08:00
Alan Wang
65578af8cc
Merge pull request #453 from Alanscut/add-return-value
add return value for  cJSON_AddItemTo... and cJSON_ReplaceItemxxx
2020-04-02 19:41:56 +08:00
Alan Wang
f12cd7b701
Merge pull request #451 from Alanscut/20200324
add new function of `cJSON_SetValuestring`
2020-04-02 19:40:03 +08:00
Sang-Heon Jeon
97cf1d84e4 Add getNumberValue function
* Add GetNumberValue function and testcase

Co-authored-by: Alan Wang <wp_scut@163.com>
2020-04-02 19:36:35 +08:00
caglarivriz
983bb2b4d6 Added cJSON_ParseWithLength (#358)
Co-authored-by: Caglar Ivriz <caglar.ivriz@siemens.com>
2020-04-02 19:24:36 +08:00
Alanscut
4e114c1f31 update testcase, fixes #433 2020-04-02 16:24:10 +08:00
Alanscut
af56a146fd update testcase 2020-04-02 11:06:47 +08:00
Alanscut
bd7cbe9776 false has been redefined to cJSON_False 2020-04-01 19:19:00 +08:00
Alanscut
54d6b8016e add return value for cJSON_AddItemTo... 2020-03-26 14:18:52 +08:00
Alanscut
31c7880fab update cJSON_SetValuestring and testcase 2020-03-25 15:38:54 +08:00
Alanscut
4790c3c8f5 add testcase for cJSON_SetValuestringToObject 2020-03-24 22:28:27 +08:00
Alan Wang
3ece4c893c
Improve performance of adding item to array (#448)
* use prev pointer when adding item to array

Co-authored-by: xiaomianhehe <hongshaokai@hotmail.com>
Co-authored-by: Alanscut <scut@163.com>

Date:   Tue Feb 18 11:54:23 2020 +0800

* add testcase for cJSON_DeleteItemFromArray
2020-03-24 16:17:25 +08:00
Alanscut
d92c0de7e8 fix encode_string_as_pointer 2020-03-18 16:04:58 +08:00
Alan Wang
9034a9cd0b Revert "use prev pointer when array do adding (#430)"
This reverts commit e8077d0150.
2020-03-16 23:04:39 +08:00
xiaomianhehe
e8077d0150
use prev pointer when array do adding (#430)
* use prev pointer when array do adding
2020-02-18 11:54:23 +08:00
Alanscut
1f970e7db3 fix double comparison 2019-12-06 17:11:12 +08:00
Alanscut
446ff0d6cc fix issue#327 2019-11-28 09:56:04 +08:00
Alanscut
166c814cda eliminate warning when compiling cJSON 2019-08-12 17:06:29 +08:00
Max Bruckner
08d2bc766a Fix infinite loop in cJSON_Minify 2019-05-16 20:01:02 +02:00
Winterreise
19ff92da79 Add link dependency to fix tests link error when ENABLE_CJSON_UTILS is ON 2019-05-11 07:37:33 +08:00
Max Bruckner
a43fa56a63 Rewrite cJSON_Minify, fixing buffer overflows, fixes #338
Also first tests for cJSON_Minify.
Thanks @bigric3 for reporting
2019-04-14 23:18:48 +02:00
Max Bruckner
be749d7efa Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays 2018-12-16 11:06:40 +01:00
Max Bruckner
543ab5d08a Update json-patch-tests 2018-10-11 00:30:43 +02:00
Zach Hindes
d9fe34bade Add newline to end of unity_setup.c 2018-09-17 09:10:20 -05:00
Zach Hindes
f25b8448e4 Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
Zach Hindes
ad2cb5b7ea Enable build and test on Windows 2018-09-04 14:36:21 -05: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
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
e7d0c1dc37 Tests: Test if the readme examples are working 2017-12-31 01:35:09 +01:00
Max Bruckner
77931e7fc0 cJSON_Add...ToObject: Add tests for failure conditions 2017-12-29 23:26:53 +01:00
Max Bruckner
5865faffa3 Convert cJSON_Add...ToObject macros into functions
These functions return the added object. Functions to add objects and
arrays have also been added.
2017-12-28 23:56:39 +01:00
Max Bruckner
f966409b33 Add tests for cJSON_Add...ToObject macros 2017-12-28 22:56:57 +01:00
Max Bruckner
2a087843e4 Add overrides for BUILD_SHARED_LIBS 2017-11-28 17:16:11 +01:00
Max Bruckner
eb7c681a4b Fix tests when building as static library 2017-11-28 16:44:24 +01:00
Max Bruckner
0476590a0c Update Unity to 2.4.3 2017-11-28 03:15:50 +01:00
Max Bruckner
11844dd5a6 Add cJSON_Create{Array,Object}Reference 2017-11-28 03:06:02 +01:00
Max Bruckner
eaa90a6b74 Add cJSON_CreateStringReference 2017-11-28 02:02:55 +01:00
Max Bruckner
043507872e Update json-patch-tests 2017-11-20 22:04:57 +01:00
Max Bruckner
b2afbd3c9f cJSON_GetStringValue 2017-11-15 18:47:49 +01:00
yangfl
fa00278f66 Remove trailing space 2017-11-04 21:19:15 +08:00
Max Bruckner
97d7347a6e Merge branch 'develop' 2017-10-08 22:05:02 +02:00
Max Bruckner
acf80470f8 Update Unity to version v2.4.2
Merge commit 'b7bfe1e91a0b55d72f849944d5a33b7962d7bf51' into develop
2017-09-12 18:30:07 +02:00
Max Bruckner
d92754cd30 Add valgrind suppressions for ARMv7 2017-09-08 13:25:14 +02:00
rmallins
629c354390 Rewrite test for cJSON_ParseWithOpts() to expect non-null error
pointer in error case and change code to match new expectations.
2017-09-08 01:22:10 +01:00
rmallins
1b2236a9a6 Improve existing tests showing behaviour of Parse and ParseWithOpts functions. 2017-09-08 01:20:52 +01:00
Max Bruckner
469a437e2a Add valgrind suppressions for ARVMv7 ArchlinuxARM 2017-07-15 11:59:47 +02:00
Max Bruckner
954d61e5e7 Fix #189, ensure returns an invalid pointer
If realloc returns NULL, ensure didn't abort but returned
printbuffer.offset instead. If an attacker can control
printbuffer.offset and also make realloc fail at just the right moment,
this would make cJSON potentially write at an arbitrary memory address.
2017-07-12 23:02:31 +02:00
Max Bruckner
5baa77f86c cJSON_Parse{,WithOpts}: Skip UTF-8 (Byte Order Marks) 2017-07-03 22:28:04 +02:00