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

fix(neon): Fix a panic when borrowing an empty buffer or typed array #1058

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

kjvalencik
Copy link
Member

The borrow API currently panics if trying to borrow an empty buffer. This is because the pointer will be nil.

This PR adds guards for length != 0. Additionally, the ledger skips adding/removing empty buffers.

@kjvalencik kjvalencik requested a review from dherman July 17, 2024 21:41
@kjvalencik kjvalencik force-pushed the kv/borrow-fix branch 2 times, most recently from 53e1ad7 to 8e85ff7 Compare July 18, 2024 15:57
Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! LGTM.

@kjvalencik kjvalencik merged commit 922e93a into main Jul 23, 2024
9 checks passed
@kjvalencik kjvalencik deleted the kv/borrow-fix branch July 23, 2024 18:44
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