File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ PHP NEWS
6
6
. Fix incorrect timeout in built-in web server when using router script and
7
7
max_input_time. (ilutov)
8
8
9
+ - Opcache:
10
+ . Fixed oss-fuzz #64727 (JIT undefined array key warning may overwrite DIM
11
+ with NULL when DIM is the same var as result). (ilutov)
12
+
9
13
21 Dec 2023, PHP 8.2.14
10
14
11
15
- Core:
Original file line number Diff line number Diff line change @@ -205,14 +205,14 @@ void ZEND_FASTCALL zend_jit_undefined_long_key(EXECUTE_DATA_D)
205
205
zval * result = EX_VAR (opline -> result .var );
206
206
zval * dim ;
207
207
208
- ZVAL_NULL (result );
209
208
if (opline -> op2_type == IS_CONST ) {
210
209
dim = RT_CONSTANT (opline , opline -> op2 );
211
210
} else {
212
211
dim = EX_VAR (opline -> op2 .var );
213
212
}
214
213
ZEND_ASSERT (Z_TYPE_P (dim ) == IS_LONG );
215
214
zend_error (E_WARNING , "Undefined array key " ZEND_LONG_FMT , Z_LVAL_P (dim ));
215
+ ZVAL_NULL (result );
216
216
}
217
217
218
218
void ZEND_FASTCALL zend_jit_undefined_string_key (EXECUTE_DATA_D )
@@ -222,7 +222,6 @@ void ZEND_FASTCALL zend_jit_undefined_string_key(EXECUTE_DATA_D)
222
222
zval * dim ;
223
223
zend_ulong lval ;
224
224
225
- ZVAL_NULL (result );
226
225
if (opline -> op2_type == IS_CONST ) {
227
226
dim = RT_CONSTANT (opline , opline -> op2 );
228
227
} else {
@@ -234,6 +233,7 @@ void ZEND_FASTCALL zend_jit_undefined_string_key(EXECUTE_DATA_D)
234
233
} else {
235
234
zend_error (E_WARNING , "Undefined array key \"%s\"" , Z_STRVAL_P (dim ));
236
235
}
236
+ ZVAL_NULL (result );
237
237
}
238
238
239
239
ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_profile_helper (ZEND_OPCODE_HANDLER_ARGS )
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ oss-fuzz #64727
3
+ --INI--
4
+ opcache.enable_cli=1
5
+ opcache.jit_buffer_size=64M
6
+ opcache.jit=function
7
+ --EXTENSIONS--
8
+ opcache
9
+ --FILE--
10
+ <?php
11
+ function test (){
12
+ $ a = null ;
13
+ $ b = null ;
14
+ for ($ i = 0 ; $ i < 2 ; $ i ++){
15
+ $ a = $ a + $ b ;
16
+ var_dump ($ a );
17
+ $ a = @[3 ][$ a ];
18
+ var_dump ($ a );
19
+ }
20
+ }
21
+ test ();
22
+ ?>
23
+ --EXPECT--
24
+ int(0)
25
+ int(3)
26
+ int(3)
27
+ NULL
You can’t perform that action at this time.
0 commit comments