Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use strlen() instead of allocation size #1169

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

Jalle19
Copy link
Collaborator

@Jalle19 Jalle19 commented Aug 7, 2024

Fixes regression introduced in #1168. AFAICT the original code worked because we allocated the string using char[], but now with dynamic allocation we need to use strlen() instead, otherwise we'll have to deal with NULL characters in the loop manually.

@Jalle19 Jalle19 requested a review from catalinii August 7, 2024 06:33
Since we no longer use stack allocated char[] it's important which one we use
@Jalle19 Jalle19 force-pushed the fix-escape-json-string branch from 006516e to 8545c94 Compare August 7, 2024 06:47
@Jalle19 Jalle19 changed the title Don't attempt to escape null characters Use strlen() instead of allocation size Aug 7, 2024
@Jalle19 Jalle19 merged commit 1905e29 into catalinii:master Aug 7, 2024
10 checks passed
@Jalle19 Jalle19 deleted the fix-escape-json-string branch August 7, 2024 06:53
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.

1 participant