Skip to content

Zend: include() with a non-literal argument reads out of bounds with … - #23095

Closed
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:gh23083
Closed

Zend: include() with a non-literal argument reads out of bounds with …#23095
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:gh23083

Conversation

@devnexen

@devnexen devnexen commented Aug 6, 2026

Copy link
Copy Markdown
Member

…error_include_args=1.

Fix #23083

RT_CONSTANT() is only valid when op1 is a literal, so a CV or TMP operand turned a frame offset into a pointer inside the opline array. Read the operand from the call frame instead unless op1_type is IS_CONST.

…error_include_args=1.

Fix php#23083

RT_CONSTANT() is only valid when op1 is a literal, so a CV or TMP operand
turned a frame offset into a pointer inside the opline array. Read the
operand from the call frame instead unless op1_type is IS_CONST.

@NattyNarwhal NattyNarwhal 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.

Thanks for catching my mistake here

@devnexen
devnexen marked this pull request as ready for review August 6, 2026 20:31
@NattyNarwhal

Copy link
Copy Markdown
Member

IMHO I think the long term solution would be doing something like #22851 (comment) but the logic is pretty hairy in that function already.

@devnexen devnexen closed this in bf2ba7a Aug 6, 2026
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.

SEGV build_trace_args in zend_exceptions.c -d error_include_args=On

2 participants