Skip to content

Commit e4f6598

Browse files
hotfix opline out of bounds check (#3417)
1 parent 3afaeaf commit e4f6598

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

profiling/src/profiling/stack_walking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ fn opline_in_bounds(op_array: &zend_op_array, opline: *const zend_op) -> bool {
118118
}
119119

120120
let begin = opcodes_start as usize;
121-
let end = begin + (op_array.last as usize);
121+
// `op_array.last` is a count of `zend_op` sized elements to be found in `op_array.opcodes`
122+
let end = begin + (op_array.last as usize) * core::mem::size_of::<zend_op>();
122123
(begin..end).contains(&(opline as usize))
123124
}
124125

0 commit comments

Comments
 (0)