Skip to content

Commit

Permalink
Fixed possible double free of class static members
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Jan 23, 2015
1 parent 46e486f commit a7f1bf3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Zend/zend_opcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce)
}
if (ce->static_members_table) {
zval *static_members = ce->static_members_table;
int count = ce->default_static_members_count;
int i;

ce->static_members_table = NULL;
for (i = 0; i < ce->default_static_members_count; i++) {
ce->default_static_members_count = 0;
ce->default_static_members_table = ce->static_members_table = NULL;
for (i = 0; i < count; i++) {
zval_ptr_dtor(&static_members[i]);
ZVAL_UNDEF(&static_members[i]);
}
efree(static_members);
}
}

Expand Down

0 comments on commit a7f1bf3

Please sign in to comment.