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

Raise ValueError when a NULL string is passed to HPyBytes_FromStringAndSize #127

Closed
hodgestar opened this issue Dec 2, 2020 · 1 comment

Comments

@hodgestar
Copy link
Contributor

PyBytes_FromStringAndSize creates an uninitialized PyBytes object when PyBytes_FromStringAndSize(NULL, n) is called. Since the underlying bytes can't be initialized later from the HPy API we should return HPy_NULL and set an exception instead.

This is already done in the PyPy implementation -- see https://foss.heptapod.net/pypy/pypy/-/merge_requests/778.

@hodgestar
Copy link
Contributor Author

Addressed in #179.

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