Fix out of bounds read in sccp

This commit is contained in:
Nikita Popov 2019-06-28 12:38:28 +02:00
parent 50cce5eb4f
commit ca6f41aa5a

View file

@ -2329,6 +2329,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
if (opline->opcode == ZEND_DO_ICALL) {
removed_ops = remove_call(ctx, opline, ssa_op);
} else if (opline->opcode == ZEND_TYPE_CHECK
&& ssa_op->op1_use >= 0
&& !value_known(&ctx->values[ssa_op->op1_use])) {
/* For TYPE_CHECK we may compute the result value without knowing the
* operand, based on type inference information. Make sure the operand is