Fix UB pointer arithmetics on NULL

Closes GH-9559
This commit is contained in:
Ilija Tovilo 2022-09-16 17:07:52 +02:00
parent 3f1e9235e1
commit fe0eaf107a
No known key found for this signature in database
GPG key ID: A4F5D403F118200A

View file

@ -305,12 +305,14 @@ ZEND_API void destroy_zend_class(zval *zv)
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
p = ce->default_properties_table; if (ce->default_properties_table) {
end = p + ce->default_properties_count; p = ce->default_properties_table;
end = p + ce->default_properties_count;
while (p < end) { while (p < end) {
zval_ptr_dtor_nogc(p); zval_ptr_dtor_nogc(p);
p++; p++;
}
} }
return; return;
} }