]> git.feebdaed.xyz Git - 0xmirror/cJSON.git/log
0xmirror/cJSON.git
15 months agoCheck for NULL in cJSON_DetachItemViaPointer
Nicolas Badoux [Fri, 23 Aug 2024 14:14:10 +0000 (14:14 +0000)]
Check for NULL in cJSON_DetachItemViaPointer

18 months agoRevert "feat: add tests for #842" to fix test failures
Alanscut [Wed, 19 Jun 2024 02:43:55 +0000 (10:43 +0800)]
Revert "feat: add tests for #842" to fix test failures

This reverts commit 5b502cdbfb21fbe5f6cf9ffbd2b96e4281a741e6.

Related to #860

19 months agoFix spelling errors found by CodeSpell. See https://github.com/codespell-project...
Shaun Case [Fri, 29 Mar 2024 17:55:41 +0000 (10:55 -0700)]
Fix spelling errors found by CodeSpell.  See https://github.com/codespell-project/codespell

19 months agoFix indentation (should use spaces)
DL6ER [Tue, 26 Dec 2023 08:44:51 +0000 (09:44 +0100)]
Fix indentation (should use spaces)

Signed-off-by: DL6ER <dl6er@dl6er.de>
19 months agoadd contributors
Alanscut [Mon, 13 May 2024 09:39:07 +0000 (17:39 +0800)]
add contributors

19 months agoRelease 1.7.18
Alanscut [Mon, 13 May 2024 09:38:26 +0000 (17:38 +0800)]
Release 1.7.18

19 months agofeat: add tests for #842
Alanscut [Thu, 9 May 2024 02:45:16 +0000 (10:45 +0800)]
feat: add tests for #842

Add some tests for setting NULL to deallocated pointers
releated to #842 and #833

19 months agoSet free'd pointers to NULL whenever they are not reassigned immediately after
maebex [Sat, 30 Mar 2024 09:42:22 +0000 (10:42 +0100)]
Set free'd pointers to NULL whenever they are not reassigned immediately after

19 months agofix: remove misused optimization flag -01
Alanscut [Thu, 9 May 2024 01:53:14 +0000 (09:53 +0800)]
fix: remove misused optimization flag -01

related to #850

19 months agoFix heap buffer overflow
orri [Tue, 30 Apr 2024 09:50:19 +0000 (09:50 +0000)]
Fix heap buffer overflow

Fixes #800

19 months agoAdd test for heap buffer overflow
orri [Tue, 30 Apr 2024 09:46:17 +0000 (09:46 +0000)]
Add test for heap buffer overflow

From #800

19 months agoRemove non-functional list handling of compiler flags
orri [Tue, 30 Apr 2024 08:18:17 +0000 (08:18 +0000)]
Remove non-functional list handling of compiler flags

19 months agoupdate comments and add tests for cJSON_SetValuestring
Alanscut [Sun, 28 Apr 2024 10:09:25 +0000 (18:09 +0800)]
update comments and add tests for cJSON_SetValuestring

20 months agofix: fix incorrect name in security.md
Alanscut [Sun, 28 Apr 2024 01:53:34 +0000 (09:53 +0800)]
fix: fix incorrect name in security.md

Related to #845

20 months agoCreate SECURITY.md
Alan Wang [Fri, 26 Apr 2024 08:58:00 +0000 (16:58 +0800)]
Create SECURITY.md

20 months agoAdd NULL check to cJSON_SetValuestring()
Up-wind [Mon, 25 Mar 2024 12:07:11 +0000 (20:07 +0800)]
Add NULL check to cJSON_SetValuestring()

If the valuestring passed to cJSON_SetValuestring is NULL, a null pointer dereference will happen.

This commit adds the NULL check of valuestring before it is dereferenced.

2 years agoRelease 1.7.17
Alanscut [Tue, 26 Dec 2023 02:07:05 +0000 (10:07 +0800)]
Release 1.7.17

update version to 1.7.17

2 years agofix error in null checkings (#810)
Lee [Wed, 20 Dec 2023 03:05:23 +0000 (11:05 +0800)]
fix error in null checkings (#810)

fixes #802 and #803

2 years agoadd NULL checkings (#809)
Lee [Mon, 18 Dec 2023 03:47:52 +0000 (11:47 +0800)]
add NULL checkings (#809)

* add NULL checks in cJSON_SetValuestring

Fixes #803(CVE-2023-50472)

* add NULL check in cJSON_InsertItemInArray

Fixes #802(CVE-2023-50471)

* add tests for NULL checks

add tests for NULL checks in cJSON_InsertItemInArray and cJSON_SetValuestring

2 years agoRelease 1.7.16 (#770)
Alan Wang [Wed, 5 Jul 2023 03:22:19 +0000 (11:22 +0800)]
Release 1.7.16 (#770)

* Update version to 1.7.16

* Update contributors

2 years agoupgrade clang to fix actions error (#768)
Alan Wang [Tue, 4 Jul 2023 09:02:03 +0000 (17:02 +0800)]
upgrade clang to fix actions error (#768)

Actions builds are failing because clang-8 is failing to be installed. Upgrade clang-8 to clang-14 to fix this.

2 years agoAdd meson documentation (#761)
MaxBrandtner [Mon, 3 Jul 2023 01:35:30 +0000 (03:35 +0200)]
Add meson documentation (#761)

2 years agoFix a null pointer crash in cJSON_ReplaceItemViaPointer (#726)
hopper-vul [Sat, 1 Jul 2023 08:18:32 +0000 (16:18 +0800)]
Fix a null pointer crash in cJSON_ReplaceItemViaPointer (#726)

If the parent passed in cJSON_ReplaceItemViaPointer has not a child, which means parent->child is null, a null pointer dereference crash will be happened inside cJSON_ReplaceItemViaPointer.

This commit adds the NULL check of `parent->child` beforehand to inform user such incorrect usage.

Signed-off-by: hopper-vul <hopper.vul@gmail.com>
3 years agofix: add allocate check for replace_item_in_object (#675)
Junbo Zheng [Tue, 29 Mar 2022 07:02:59 +0000 (15:02 +0800)]
fix: add allocate check for replace_item_in_object (#675)

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
3 years agofeat: add cJSON_SetBoolValue and test (#639)
Stoian Ivanov [Wed, 26 Jan 2022 12:24:50 +0000 (14:24 +0200)]
feat: add cJSON_SetBoolValue and test (#639)

* cJSON_SetBoolValue plus test

* cJSON_Invalid insted of just 0

* Update tests/misc_tests.c

* VSCode standard C formater applied

Co-authored-by: Alan Wang <wp_scut@163.com>
3 years agodocs: Fix README typo (#664)
mohawk2 [Wed, 26 Jan 2022 12:23:33 +0000 (12:23 +0000)]
docs: Fix README typo (#664)

3 years agochore: add CIFuzz integration (#437)
Randy [Thu, 20 Jan 2022 06:23:57 +0000 (07:23 +0100)]
chore: add CIFuzz integration (#437)

* CIFuzz integration

* Rename main.yml to ci-fuzz.yml

3 years agochore: ignore all .dylib files (#628)
Tony Langhammer [Thu, 20 Jan 2022 06:17:46 +0000 (07:17 +0100)]
chore: ignore all .dylib files (#628)

This fixes some .dylib files being flagged as added when compiled e.g. `libcjson.dylib.1.7.14`

3 years agofix: 'cjson_utils-static' target not exist(#625)
10km [Wed, 19 Jan 2022 08:28:29 +0000 (16:28 +0800)]
fix: 'cjson_utils-static' target not exist(#625)

* Update CMakeLists.txt

fix the bug:when build with cmake using option '-DBUILD_SHARED_AND_STATIC_LIBS=ON -DENABLE_CJSON_UTILS=ON', build sucess,
but use cmake comand 'find_package(cjson CONFIG)', 'cjson_utils' target is available,but  'cjson_utils-static' target not exist.

3 years agoadd an option for ENABLE_CJSON_VERSION_SO in CMakeLists.txt (#534)
Andy [Wed, 19 Jan 2022 06:45:02 +0000 (14:45 +0800)]
add an option for ENABLE_CJSON_VERSION_SO in CMakeLists.txt (#534)

Co-authored-by: m00209177 <malihu@huawei.com>
3 years agofix: print int without decimal places (#630)
AlexanderVasiljev [Wed, 19 Jan 2022 02:30:31 +0000 (05:30 +0300)]
fix: print int without decimal places (#630)

4 years agochore: ignore *.lst/*.lss file (#623)
Alan Wang [Fri, 22 Oct 2021 08:21:55 +0000 (16:21 +0800)]
chore: ignore *.lst/*.lss file (#623)

4 years agobuild: Bump cmake version and use new version syntax (#587)
Joshua Arulsamy [Fri, 22 Oct 2021 08:15:19 +0000 (02:15 -0600)]
build: Bump cmake version and use new version syntax (#587)

Co-authored-by: Alan Wang <wp_scut@163.com>
4 years agodocs: update comment (#622)
Alan Wang [Fri, 22 Oct 2021 08:09:45 +0000 (16:09 +0800)]
docs: update comment (#622)

4 years agofix: add cmake_policy to CMakeLists.txt (#613)
SuperHuan [Fri, 22 Oct 2021 08:02:06 +0000 (16:02 +0800)]
fix: add cmake_policy to CMakeLists.txt (#613)

Use the cmake_policy() command to set CMP0054 to NEW explicitly.

4 years agofix: for issue #569, now use the guard to turn it off (#617)
Sayan Bandyopadhyay [Fri, 22 Oct 2021 07:57:05 +0000 (00:57 -0700)]
fix: for issue #569, now use the guard to turn it off (#617)

4 years agofix: potential memory leak in merge_patch() (#611)
Alan Wang [Thu, 26 Aug 2021 06:13:42 +0000 (14:13 +0800)]
fix: potential memory leak in merge_patch() (#611)

4 years agochore: update version and changelog (#610)
Alan Wang [Wed, 25 Aug 2021 11:15:09 +0000 (19:15 +0800)]
chore: update version and changelog (#610)

4 years agofix: remove redundant condition (#605)
Alan Wang [Wed, 25 Aug 2021 07:02:00 +0000 (15:02 +0800)]
fix: remove redundant condition (#605)

4 years agoTypos found by codespell (#607)
Dimitri Papadopoulos Orfanos [Wed, 25 Aug 2021 07:01:12 +0000 (10:01 +0300)]
Typos found by codespell (#607)

4 years agoUpdate .gitattributes (#544)
CoffeeTableEspresso [Thu, 31 Dec 2020 02:38:10 +0000 (21:38 -0500)]
Update .gitattributes (#544)

4 years agoFix potential core dumped for strrchr (#546)
Alan Wang [Thu, 31 Dec 2020 02:26:39 +0000 (10:26 +0800)]
Fix potential core dumped for strrchr (#546)

5 years agoRemove always true condition in cJSON.c (#539)
Jordan IMBERT [Thu, 17 Dec 2020 09:07:18 +0000 (10:07 +0100)]
Remove always true condition in cJSON.c (#539)

5 years agoFix null pointer crash, closes #536 (#538)
Alan Wang [Thu, 17 Dec 2020 07:42:31 +0000 (15:42 +0800)]
Fix null pointer crash, closes #536 (#538)

5 years agodocs: fix simple typo, transfering -> transferring (#527)
Tim Gates [Mon, 16 Nov 2020 00:57:02 +0000 (11:57 +1100)]
docs: fix simple typo, transfering -> transferring (#527)

There is a small typo in tests/readme_examples.c.

Should read `transferring` rather than `transfering`.

5 years agofix several null pointer problems on allocation failure (#526)
mongobaba [Thu, 12 Nov 2020 03:46:15 +0000 (11:46 +0800)]
fix several null pointer problems on allocation failure (#526)

5 years agoMerge pull request #519 from Alanscut/issue-516
Alan Wang [Fri, 16 Oct 2020 09:12:54 +0000 (17:12 +0800)]
Merge pull request #519 from Alanscut/issue-516

fix a possible dereference of null pointer

5 years agofix a possible dereference of null pointer
Alanscut [Fri, 16 Oct 2020 09:06:29 +0000 (17:06 +0800)]
fix a possible dereference of null pointer

5 years agoMerge pull request #518 from fpnuseis/master
Alan Wang [Fri, 16 Oct 2020 08:52:10 +0000 (16:52 +0800)]
Merge pull request #518 from fpnuseis/master

fix: windows build failure about defining nan

5 years agofix: windows build failure about defining nan
Use [Thu, 15 Oct 2020 02:52:06 +0000 (11:52 +0900)]
fix: windows build failure about defining nan

5 years agoMerge pull request #505 from Alanscut/release-1.7.14
Alan Wang [Thu, 3 Sep 2020 09:14:26 +0000 (17:14 +0800)]
Merge pull request #505 from Alanscut/release-1.7.14

Release 1.7.14

5 years agoUpdate changelog and contributors
Alanscut [Thu, 3 Sep 2020 09:11:02 +0000 (17:11 +0800)]
Update changelog and contributors

5 years agoUpdate version to 1.7.14
Alanscut [Thu, 3 Sep 2020 09:07:49 +0000 (17:07 +0800)]
Update version to 1.7.14

5 years agoMerge pull request #503 from Alanscut/issue499
Alan Wang [Thu, 3 Sep 2020 03:51:54 +0000 (11:51 +0800)]
Merge pull request #503 from Alanscut/issue499

optimize the way to find tail node

5 years agooptimize the way to find tail node
Alanscut [Wed, 2 Sep 2020 12:23:52 +0000 (20:23 +0800)]
optimize the way to find tail node

5 years agoMerge pull request #502 from Alanscut/nan
Alan Wang [Thu, 27 Aug 2020 12:48:25 +0000 (20:48 +0800)]
Merge pull request #502 from Alanscut/nan

remove float-divide-by-zero for supporting NAN

5 years agoremove float-divide-by-zero for supporting NAN
Alanscut [Thu, 27 Aug 2020 12:46:00 +0000 (20:46 +0800)]
remove float-divide-by-zero for supporting NAN

5 years agoMerge pull request #501 from Alanscut/actions
Alan Wang [Thu, 27 Aug 2020 12:28:06 +0000 (20:28 +0800)]
Merge pull request #501 from Alanscut/actions

add github actions CI

5 years agoadd github actions CI
Alanscut [Thu, 27 Aug 2020 12:26:04 +0000 (20:26 +0800)]
add github actions CI

5 years agoMerge pull request #484 from sappo/master
Alan Wang [Fri, 21 Aug 2020 13:30:19 +0000 (21:30 +0800)]
Merge pull request #484 from sappo/master

Problem: WError error on macosx because NAN is a float

5 years agoMerge pull request #485 from HuKeping/fix-git-archive
Alan Wang [Sat, 27 Jun 2020 08:13:52 +0000 (16:13 +0800)]
Merge pull request #485 from HuKeping/fix-git-archive

Remove unnecessary files in release tarball

5 years agoRemove unnecessary files in release tarball
h00283522 [Fri, 26 Jun 2020 02:37:00 +0000 (10:37 +0800)]
Remove unnecessary files in release tarball

Prior to this patch, we would find '.gitignore', '.travisCI.yml' in
the release tarball.

This patch adds a few entries in .gitattributes to specify files that
should never end up in a distribution tarball.

Signed-off-by: Hu Keping <hukeping@huawei.com>
5 years agoProblem: WError error on macosx because NAN is a float
Kevin Sapper [Tue, 23 Jun 2020 07:16:26 +0000 (09:16 +0200)]
Problem: WError error on macosx because NAN is a float

Solution: Add explicit cast from NAN to double

5 years agofix #376
Alanscut [Mon, 22 Jun 2020 03:23:24 +0000 (11:23 +0800)]
fix #376

5 years agoMerge pull request #472 from Alanscut/parse-array
Alan Wang [Wed, 6 May 2020 09:34:15 +0000 (17:34 +0800)]
Merge pull request #472 from Alanscut/parse-array

array's item should be in the list

5 years agoarray's item should be in the list
Alanscut [Wed, 6 May 2020 09:18:42 +0000 (17:18 +0800)]
array's item should be in the list

5 years agoMerge pull request #456 from miaoerduo/master
Alan Wang [Wed, 6 May 2020 09:07:33 +0000 (17:07 +0800)]
Merge pull request #456 from miaoerduo/master

fix: some bugs in detach and replace, resolved #467

5 years agoMerge pull request #469 from moorthy-bs/master
Alan Wang [Tue, 5 May 2020 03:34:23 +0000 (11:34 +0800)]
Merge pull request #469 from moorthy-bs/master

pkgconfig: cjson include dir added

5 years agoMerge pull request #465 from Summus-git/fix_make_install_config
Alan Wang [Tue, 5 May 2020 03:31:39 +0000 (11:31 +0800)]
Merge pull request #465 from Summus-git/fix_make_install_config

Make install unwanted config files

5 years agopkgconfig: cjson include dir added
Moorthy [Thu, 30 Apr 2020 10:43:44 +0000 (16:13 +0530)]
pkgconfig: cjson include dir added

fixed #468

5 years agoFix make.sh install unwanted config files
Romain Lesteven [Fri, 17 Apr 2020 10:01:39 +0000 (12:01 +0200)]
Fix make.sh install unwanted config files

5 years agofix: errors in replacing the first item when array_size is 1, and replacing the last...
miaoerduo [Fri, 3 Apr 2020 06:47:49 +0000 (14:47 +0800)]
fix: errors in replacing the first item when array_size is 1, and replacing the last item

5 years agofix: error list head's prev when detach the last item
miaoerduo [Fri, 3 Apr 2020 06:07:22 +0000 (14:07 +0800)]
fix: error list head's prev when detach the last item

5 years agofeat: set list head's prev in parse_array and parse_object
miaoerduo [Fri, 3 Apr 2020 03:52:54 +0000 (11:52 +0800)]
feat: set list head's prev in parse_array and parse_object

5 years agoUpdate changelog
Alanscut [Thu, 2 Apr 2020 15:35:50 +0000 (23:35 +0800)]
Update changelog

5 years agoUpdate version to 1.7.13
Alanscut [Thu, 2 Apr 2020 15:34:28 +0000 (23:34 +0800)]
Update version to 1.7.13

5 years agofix error C2124 in visual studio
Alanscut [Thu, 2 Apr 2020 15:32:30 +0000 (23:32 +0800)]
fix error C2124 in visual studio

5 years agoMerge pull request #454 from Alanscut/float-compare
Alan Wang [Thu, 2 Apr 2020 12:09:42 +0000 (20:09 +0800)]
Merge pull request #454 from Alanscut/float-compare

comparing double value with DBL_EPSILON

5 years agoMerge pull request #453 from Alanscut/add-return-value
Alan Wang [Thu, 2 Apr 2020 11:41:56 +0000 (19:41 +0800)]
Merge pull request #453 from Alanscut/add-return-value

add return value for  cJSON_AddItemTo... and cJSON_ReplaceItemxxx

5 years agoMerge pull request #451 from Alanscut/20200324
Alan Wang [Thu, 2 Apr 2020 11:40:03 +0000 (19:40 +0800)]
Merge pull request #451 from Alanscut/20200324

add new function of `cJSON_SetValuestring`

5 years agoAdd getNumberValue function
Sang-Heon Jeon [Thu, 2 Apr 2020 09:06:56 +0000 (18:06 +0900)]
Add getNumberValue function

* Add GetNumberValue function and testcase

Co-authored-by: Alan Wang <wp_scut@163.com>
5 years agoAdded cJSON_ParseWithLength (#358)
caglarivriz [Thu, 2 Apr 2020 08:59:19 +0000 (11:59 +0300)]
Added cJSON_ParseWithLength (#358)

Co-authored-by: Caglar Ivriz <caglar.ivriz@siemens.com>
5 years agoupdate testcase, fixes #433
Alanscut [Thu, 2 Apr 2020 08:24:10 +0000 (16:24 +0800)]
update testcase, fixes #433

5 years agocomparing double value with DBL_EPSILON
Alanscut [Thu, 2 Apr 2020 08:02:24 +0000 (16:02 +0800)]
comparing double value with DBL_EPSILON

5 years agoupdate testcase
Alanscut [Thu, 2 Apr 2020 03:06:47 +0000 (11:06 +0800)]
update testcase

5 years agoadd return value for cJSON_ReplaceItemxxx
Alanscut [Thu, 2 Apr 2020 01:11:36 +0000 (09:11 +0800)]
add return value for cJSON_ReplaceItemxxx

5 years agofalse has been redefined to cJSON_False
Alanscut [Wed, 1 Apr 2020 11:19:00 +0000 (19:19 +0800)]
false has been redefined to cJSON_False

5 years agoadd return value for cJSON_AddItemTo...
Alanscut [Thu, 26 Mar 2020 06:18:52 +0000 (14:18 +0800)]
add return value for  cJSON_AddItemTo...

5 years agoupdate cJSON_SetValuestring and testcase
Alanscut [Wed, 25 Mar 2020 07:38:54 +0000 (15:38 +0800)]
update cJSON_SetValuestring and testcase

5 years agoupdate README
Alanscut [Tue, 24 Mar 2020 14:28:35 +0000 (22:28 +0800)]
update README

5 years agoadd testcase for cJSON_SetValuestringToObject
Alanscut [Tue, 24 Mar 2020 14:28:27 +0000 (22:28 +0800)]
add testcase for cJSON_SetValuestringToObject

5 years agoadd new function of setValuestringToObject
Alanscut [Tue, 24 Mar 2020 14:28:15 +0000 (22:28 +0800)]
add new function of setValuestringToObject

5 years agoImprove performance of adding item to array (#448)
Alan Wang [Tue, 24 Mar 2020 08:17:25 +0000 (16:17 +0800)]
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

5 years agoupdate contributors
Alanscut [Thu, 19 Mar 2020 14:58:04 +0000 (22:58 +0800)]
update contributors

5 years agoMerge pull request #447 from Alanscut/fix_encode_string_as_pointer
Alan Wang [Wed, 18 Mar 2020 08:53:52 +0000 (16:53 +0800)]
Merge pull request #447 from Alanscut/fix_encode_string_as_pointer

Fix encode_string_as_pointer

5 years agofix encode_string_as_pointer
Alanscut [Wed, 18 Mar 2020 08:04:58 +0000 (16:04 +0800)]
fix encode_string_as_pointer

5 years agoMerge pull request #440 from Square789/patch-1
Alan Wang [Mon, 16 Mar 2020 15:12:14 +0000 (23:12 +0800)]
Merge pull request #440 from Square789/patch-1

updating doc

5 years agoMerge pull request #446 from DaveGamble/revert-430-array_add
Alan Wang [Mon, 16 Mar 2020 15:08:06 +0000 (23:08 +0800)]
Merge pull request #446 from DaveGamble/revert-430-array_add

Revert "use prev pointer when array do adding"

5 years agoRevert "use prev pointer when array do adding (#430)"
Alan Wang [Mon, 16 Mar 2020 15:04:39 +0000 (23:04 +0800)]
Revert "use prev pointer when array do adding (#430)"

This reverts commit e8077d01500279a7b45b8cd7a0ae94ea7ad5748a.

5 years agoSpelling; "it's"->"its"
Square789 [Mon, 9 Mar 2020 12:40:08 +0000 (13:40 +0100)]
Spelling; "it's"->"its"