Skip to content

fix: validate Buffer type in PutCopyData before calling Buffer::Data#134

Open
MinhyukHong wants to merge 4 commits intobrianc:masterfrom
MinhyukHong:fix/putcopydata-buffer-type-check
Open

fix: validate Buffer type in PutCopyData before calling Buffer::Data#134
MinhyukHong wants to merge 4 commits intobrianc:masterfrom
MinhyukHong:fix/putcopydata-buffer-type-check

Conversation

@MinhyukHong
Copy link
Copy Markdown

$putCopyData() can be called directly on the binding instance, bypassing the instanceof check in the JS wrapper. This adds the same validation at the C++ level so unexpected input throws a TypeError instead of aborting.

@brianc
Copy link
Copy Markdown
Owner

brianc commented May 7, 2026

Thanks for submitting this! you'll likely need to add a test for this. Also, I believe you're missing a closing paren?

Add test for TypeError when non-Buffer is passed to putCopyData
@MinhyukHong
Copy link
Copy Markdown
Author

Added a test case and fixed the paren. Let me know if anything else is needed! Thanks.

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