Skip to content

Add a check in cJSON_Minify#967

Open
lxyjy6 wants to merge 1 commit intoDaveGamble:masterfrom
lxyjy6:cjson4
Open

Add a check in cJSON_Minify#967
lxyjy6 wants to merge 1 commit intoDaveGamble:masterfrom
lxyjy6:cjson4

Conversation

@lxyjy6
Copy link

@lxyjy6 lxyjy6 commented Oct 22, 2025

The char* json in cJSON_Minify may not end with '\0', so I've added an extra condition in the while loop.

@imaami
Copy link

imaami commented Mar 12, 2026

This does not prevent what it purports to fix. strlen() relies on the string having a null terminator. It scans for a null byte and reports the length based on it. If the input string isn't terminated, strlen() will read past the end of the buffer just like the current code would.

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