Skip to content

Commit

Permalink
Fix UB pointer arithmetics on NULL
Browse files Browse the repository at this point in the history
Closes GH-9559
  • Loading branch information
iluuu1994 committed Sep 16, 2022
1 parent 3f1e923 commit fe0eaf1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Zend/zend_opcode.c
Expand Up @@ -305,12 +305,14 @@ ZEND_API void destroy_zend_class(zval *zv)
}
} ZEND_HASH_FOREACH_END();

p = ce->default_properties_table;
end = p + ce->default_properties_count;
if (ce->default_properties_table) {
p = ce->default_properties_table;
end = p + ce->default_properties_count;

while (p < end) {
zval_ptr_dtor_nogc(p);
p++;
while (p < end) {
zval_ptr_dtor_nogc(p);
p++;
}
}
return;
}
Expand Down

0 comments on commit fe0eaf1

Please sign in to comment.