Skip to content

fix: potential null pointer dereference in Blob constructor#1832

Open
kewde wants to merge 2 commits intomasterfrom
kewde/fix-undefined-behavior
Open

fix: potential null pointer dereference in Blob constructor#1832
kewde wants to merge 2 commits intomasterfrom
kewde/fix-undefined-behavior

Conversation

@kewde
Copy link
Collaborator

@kewde kewde commented May 30, 2025

fixes: #1827

@kewde
Copy link
Collaborator Author

kewde commented May 31, 2025

@daniellockyer would you be up to review this?

value = new char[len];
assert(value != nullptr);
memcpy(value, val, len);
if (val != nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the assertion is wrong, if a null pointer is allowed

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.

call to memcpy leads to undefined behavior

2 participants