mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-12-01 21:18:50 +00:00
Fix memory corruption when cloning objects by disallowing clone
This commit is contained in:
parent
2bec821239
commit
f8ea5648b3
2 changed files with 2 additions and 0 deletions
1
gnupg.c
1
gnupg.c
|
|
@ -533,6 +533,7 @@ PHP_MINIT_FUNCTION(gnupg)
|
|||
memcpy(&gnupg_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
gnupg_object_handlers.offset = offsetof(gnupg_object, std);
|
||||
gnupg_object_handlers.free_obj = gnupg_object_free;
|
||||
gnupg_object_handlers.clone_obj = NULL;
|
||||
|
||||
if (SUCCESS != gnupg_keylistiterator_init(type, module_number)) {
|
||||
return FAILURE;
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ int gnupg_keylistiterator_init(INIT_FUNC_ARGS)
|
|||
memcpy(&gnupg_keylistiterator_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
gnupg_keylistiterator_handlers.offset = offsetof(gnupg_keylistiterator_object, std);
|
||||
gnupg_keylistiterator_handlers.free_obj = gnupg_keylistiterator_object_free;
|
||||
gnupg_keylistiterator_handlers.clone_obj = NULL;
|
||||
|
||||
zend_class_implements(gnupg_keylistiterator_class_entry, 1, zend_ce_iterator);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue