Skip to content

precompiles: Handle allocation failure in call_precompile#1582

Open
ywy2090 wants to merge 1 commit into
ipsilon:masterfrom
ywy2090:precompile-alloc-failure
Open

precompiles: Handle allocation failure in call_precompile#1582
ywy2090 wants to merge 1 commit into
ipsilon:masterfrom
ywy2090:precompile-alloc-failure

Conversation

@ywy2090

@ywy2090 ywy2090 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The result of the nothrow output buffer allocation in call_precompile() was not checked (noted by the existing TODO: handle nullptr). On allocation failure the precompile execution would write to a null pointer. Return EVMC_INTERNAL_ERROR instead.

The result of the nothrow output buffer allocation was not checked.
On allocation failure the precompile execution would write to a null
pointer. Return EVMC_INTERNAL_ERROR instead.

@chfast chfast left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a good fix because this is not certain anyone will handle EVMC_INTERNAL_ERROR. We should redesign memory allocation for precompiles instead.

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