forked from DaveGamble/cJSON
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 766dd9d
authored
Fix a null pointer crash in cJSON_ReplaceItemViaPointer (DaveGamble#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>1 parent b45f48e commit 766dd9d
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2291 | 2291 |
| |
2292 | 2292 |
| |
2293 | 2293 |
| |
2294 | - | ||
2294 | + | ||
2295 | 2295 |
| |
2296 | 2296 |
| |
2297 | 2297 |
| |
|
0 commit comments