Skip to content

Check stack limit in fuzzer executor #19391

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sapi/fuzzer/fuzzer-execute-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,18 @@ static zend_always_inline void fuzzer_step(void) {
static void (*orig_execute_ex)(zend_execute_data *execute_data);

static void fuzzer_execute_ex(zend_execute_data *execute_data) {

#ifdef ZEND_CHECK_STACK_LIMIT
if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) {
zend_call_stack_size_error();
/* No opline was executed before exception */
EG(opline_before_exception) = NULL;
/* Fall through to handle exception below. */
}
#endif /* ZEND_CHECK_STACK_LIMIT */

const zend_op *opline = EX(opline);

while (1) {
fuzzer_step();
opline = ((opcode_handler_t) opline->handler)(execute_data, opline);
Expand Down
Loading