Skip to content

Conversation

@miaoerduo
Copy link
Contributor

@miaoerduo miaoerduo commented Apr 3, 2020

  1. set list head's prev when parse_object and parse_array
  2. detach the first item when array size is 1
  3. detach the last item
  4. replace the first item when array size is 1
  5. replace the last item

@miaoerduo miaoerduo changed the title feat: set list head's prev in parse_array and parse_object fix: some bugs in detach and replace Apr 3, 2020
success:
input_buffer->depth--;

if (head != NULL) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miaoerduo thanks your suggestion! but this change make the testcase fail, I have to make some changes for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the 0th is unnecessary? How about the others? I have test these in my project. :P

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's needed. compiling it with option cmake ENABLE_VALGRIND=On .. when make check, memory check is very important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I have commited with company's email.
So I have to changed the email in commits and force pushed again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May my modification be merged into this project?
Is there any other thing I could do?
I haven't contributed to a project with so many stars!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version is released no more than 24 hours since you make this contribution, you have done a good job :), before I merge it, I need some time to make sure it won't introduce any problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Thank YOU very much!

@Alanscut Alanscut merged commit a82449f into DaveGamble:master May 6, 2020
armcc added a commit to lgirdk/meta-mng that referenced this pull request Mar 16, 2025
  1.7.18 (May 13, 2024)
  ======

  * Add NULL check to cJSON_SetValuestring()(CVE-2024-31755), see #839 and #840
  * Remove non-functional list handling of compiler flags, see #851
  * Fix heap buffer overflow, see #852
  * Remove misused optimization flag -01, see #854
  * Set free'd pointers to NULL whenever they are not reassigned immediately after, see #855 and #833

  1.7.17 (Dec 26, 2023)
  ======

  * Fix null reference in cJSON_SetValuestring(CVE-2023-50472), see #809
  * Fix null reference in cJSON_InsertItemInArray(CVE-2023-50471), see #809 and #810

  1.7.16 (Jul 5, 2023)
  ======

  * Add an option for ENABLE_CJSON_VERSION_SO in CMakeLists.txt, see #534
  * Add cmake_policy to CMakeLists.txt, see #163
  * Add cJSON_SetBoolValue, see #639
  * Add meson documentation, see #761

  * Fix memory leak in merge_patch, see #611
  * Fix conflicting target names 'uninstall', see #617
  * Bump cmake version to 3.0 and use new version syntax, see #587
  * Print int without decimal places, see #630
  * Fix 'cjson_utils-static' target not exist, see #625
  * Add allocate check for replace_item_in_object, see #675
  * Fix a null pointer crash in cJSON_ReplaceItemViaPointer, see #726

  1.7.15 (Aug 25, 2021)
  ======

  * Fix potential core dumped for strrchr, see [#546](DaveGamble/cJSON#546)
  * Fix null pointer crash in cJSON_CreateXxArray, see [#538](DaveGamble/cJSON#538)
  * Fix several null pointer problems on allocation failure, see [#526](DaveGamble/cJSON#526)
  * Fix a possible dereference of null pointer, see [#519](DaveGamble/cJSON#519)
  * Fix windows build failure about defining nan, see [#518](DaveGamble/cJSON#518)

  1.7.14 (Sep 3, 2020)
  ======

  * Optimize the way to find tail node, see [#503](DaveGamble/cJSON#503)
  * Fix WError error on macosx because NAN is a float. Thanks @sappo, see [#484](DaveGamble/cJSON#484)
  * Fix some bugs in detach and replace. Thanks @miaoerduo, see [#456](DaveGamble/cJSON#456)

Signed-off-by: Andre McCurdy <[email protected]>
armcc added a commit to lgirdk/meta-mng that referenced this pull request Mar 30, 2025
  1.7.18 (May 13, 2024)
  ======

  * Add NULL check to cJSON_SetValuestring()(CVE-2024-31755), see #839 and #840
  * Remove non-functional list handling of compiler flags, see #851
  * Fix heap buffer overflow, see #852
  * Remove misused optimization flag -01, see #854
  * Set free'd pointers to NULL whenever they are not reassigned immediately after, see #855 and #833

  1.7.17 (Dec 26, 2023)
  ======

  * Fix null reference in cJSON_SetValuestring(CVE-2023-50472), see #809
  * Fix null reference in cJSON_InsertItemInArray(CVE-2023-50471), see #809 and #810

  1.7.16 (Jul 5, 2023)
  ======

  * Add an option for ENABLE_CJSON_VERSION_SO in CMakeLists.txt, see #534
  * Add cmake_policy to CMakeLists.txt, see #163
  * Add cJSON_SetBoolValue, see #639
  * Add meson documentation, see #761

  * Fix memory leak in merge_patch, see #611
  * Fix conflicting target names 'uninstall', see #617
  * Bump cmake version to 3.0 and use new version syntax, see #587
  * Print int without decimal places, see #630
  * Fix 'cjson_utils-static' target not exist, see #625
  * Add allocate check for replace_item_in_object, see #675
  * Fix a null pointer crash in cJSON_ReplaceItemViaPointer, see #726

  1.7.15 (Aug 25, 2021)
  ======

  * Fix potential core dumped for strrchr, see [#546](DaveGamble/cJSON#546)
  * Fix null pointer crash in cJSON_CreateXxArray, see [#538](DaveGamble/cJSON#538)
  * Fix several null pointer problems on allocation failure, see [#526](DaveGamble/cJSON#526)
  * Fix a possible dereference of null pointer, see [#519](DaveGamble/cJSON#519)
  * Fix windows build failure about defining nan, see [#518](DaveGamble/cJSON#518)

  1.7.14 (Sep 3, 2020)
  ======

  * Optimize the way to find tail node, see [#503](DaveGamble/cJSON#503)
  * Fix WError error on macosx because NAN is a float. Thanks @sappo, see [#484](DaveGamble/cJSON#484)
  * Fix some bugs in detach and replace. Thanks @miaoerduo, see [#456](DaveGamble/cJSON#456)

Signed-off-by: Andre McCurdy <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants