Skip to content

Conversation

@vwvw
Copy link
Contributor

@vwvw vwvw commented Aug 23, 2024

Add a check to be sure that the string don't overlap to avoid issues with strcpy.
Fixes #881

All the credit goes to @tregua87

@PeterAlfredLee
Copy link
Contributor

LGTM
It will be appreciated if you can also add some tests.

@vwvw
Copy link
Contributor Author

vwvw commented Aug 25, 2024

Added a test, let me know how it looks.

@Alanscut
Copy link
Collaborator

Valgrind reports.
Looks you forgot about the memory free in tests.

@vwvw
Copy link
Contributor Author

vwvw commented Aug 27, 2024

Pushed the necessary fix to make valgrind happy again!

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.

no overlap control in cJSON_SetValuestring

3 participants