Skip to content

Conversation

@hopper-vul
Copy link
Contributor

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.

fixes: #725

Signed-off-by: hopper-vul [email protected]

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 <[email protected]>
@hopper-vul hopper-vul requested a review from cragwen December 21, 2022 02:42
@hopper-vul
Copy link
Contributor Author

@cragwen Hi, would your like to review this pull request #722 which suffer from the similar issue.

@Alanscut Alanscut merged commit 766dd9d into DaveGamble:master Jul 1, 2023
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.

A null pointer crash in cJSON_ReplaceItemViaPointer

3 participants