Skip to content

Commit f6282a6

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Tracing JIT: Fixed possible stack-buffer-overflow.
2 parents 760cfaa + 757c127 commit f6282a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_trace_helper(ZEND_OPCODE_HAN
360360
trace_buffer[idx].info = _op | (_info); \
361361
trace_buffer[idx].ptr = _ptr; \
362362
idx++; \
363-
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 1) { \
363+
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 2) { \
364364
stop = ZEND_JIT_TRACE_STOP_TOO_LONG; \
365365
break; \
366366
}
@@ -372,7 +372,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_trace_helper(ZEND_OPCODE_HAN
372372
trace_buffer[idx].op3_type = _op3_type; \
373373
trace_buffer[idx].ptr = _ptr; \
374374
idx++; \
375-
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 1) { \
375+
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 2) { \
376376
stop = ZEND_JIT_TRACE_STOP_TOO_LONG; \
377377
break; \
378378
}

0 commit comments

Comments
 (0)