Skip to content

Commit fe0eaf1

Browse files
committed
Fix UB pointer arithmetics on NULL
Closes GH-9559
1 parent 3f1e923 commit fe0eaf1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Zend/zend_opcode.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,14 @@ ZEND_API void destroy_zend_class(zval *zv)
305305
}
306306
} ZEND_HASH_FOREACH_END();
307307

308-
p = ce->default_properties_table;
309-
end = p + ce->default_properties_count;
308+
if (ce->default_properties_table) {
309+
p = ce->default_properties_table;
310+
end = p + ce->default_properties_count;
310311

311-
while (p < end) {
312-
zval_ptr_dtor_nogc(p);
313-
p++;
312+
while (p < end) {
313+
zval_ptr_dtor_nogc(p);
314+
p++;
315+
}
314316
}
315317
return;
316318
}

0 commit comments

Comments
 (0)