mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-30 21:28:30 +00:00
Utils: InplaceDecodePointerString: Check for NULL
This commit is contained in:
1 parent
c49ffbfba8
commit
a2309a509d
1 file changed
+5
@@ -208,6 +208,11 @@ cJSON *cJSONUtils_GetPointer(cJSON *object, const char *pointer)
|
|||||||
static void cJSONUtils_InplaceDecodePointerString(char *string)
|
static void cJSONUtils_InplaceDecodePointerString(char *string)
|
||||||
{
|
{
|
||||||
char *s2 = string;
|
char *s2 = string;
|
||||||
|
|
||||||
|
if (string == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (; *string; s2++, string++)
|
for (; *string; s2++, string++)
|
||||||
{
|
{
|
||||||
*s2 = (*string != '~')
|
*s2 = (*string != '~')
|
||||||
|
|||||||
Reference in new issue
Block a user