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

atchops_base64_encode: return null-terminated buffer #534

Open
XavierChanth opened this issue Jan 24, 2025 · 0 comments
Open

atchops_base64_encode: return null-terminated buffer #534

XavierChanth opened this issue Jan 24, 2025 · 0 comments

Comments

@XavierChanth
Copy link
Member

atchops_base64_encode requires a pre-allocated buffer, which is an anti-pattern for returning null-terminated strings. We can coerce our own null-terminated string by allocating one byte longer than we pass as the buffer size into this function. The style for this function should change to not require input or output parameters, and the function should determine and allocate the buffer itself.

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

No branches or pull requests

1 participant