Skip to content

Commit 08100e8

Browse files
committed
Tracing JIT: Fixed possible stack-buffer-overflow.
1 parent 17a99f2 commit 08100e8

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
@@ -350,7 +350,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_trace_helper(ZEND_OPCODE_HAN
350350
trace_buffer[idx].info = _op | (_info); \
351351
trace_buffer[idx].ptr = _ptr; \
352352
idx++; \
353-
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 1) { \
353+
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 2) { \
354354
stop = ZEND_JIT_TRACE_STOP_TOO_LONG; \
355355
break; \
356356
}
@@ -362,7 +362,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_trace_helper(ZEND_OPCODE_HAN
362362
trace_buffer[idx].op3_type = _op3_type; \
363363
trace_buffer[idx].ptr = _ptr; \
364364
idx++; \
365-
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 1) { \
365+
if (idx >= ZEND_JIT_TRACE_MAX_LENGTH - 2) { \
366366
stop = ZEND_JIT_TRACE_STOP_TOO_LONG; \
367367
break; \
368368
}

0 commit comments

Comments
 (0)