summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat_class.c
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2010-12-27 01:10:08 +0000
committerGustavo André dos Santos Lopes <cataphract@php.net>2010-12-27 01:10:08 +0000
commit9ec9210fbcec3a106b593894cecd811f158acb8f (patch)
tree3689bcba8ee3ee589d557e766d56c46a56948af9 /ext/intl/msgformat/msgformat_class.c
parentcc1759598fad686aad7f7ef99cf36f144501851a (diff)
downloadphp-git-9ec9210fbcec3a106b593894cecd811f158acb8f.tar.gz
- Fixed bug #53612 (Segmentation fault when using several cloned intl
objects).
Diffstat (limited to 'ext/intl/msgformat/msgformat_class.c')
-rwxr-xr-xext/intl/msgformat/msgformat_class.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index b710ee7086..efa3a411a3 100755
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -25,6 +25,7 @@
#include "msgformat_attr.h"
zend_class_entry *MessageFormatter_ce_ptr = NULL;
+static zend_object_handlers MessageFormatter_handlers;
/*
* Auxiliary functions needed by objects of 'MessageFormatter' class
@@ -66,7 +67,7 @@ zend_object_value MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
(zend_objects_free_object_storage_t)MessageFormatter_object_free,
NULL TSRMLS_CC );
- retval.handlers = zend_get_std_object_handlers();
+ retval.handlers = &MessageFormatter_handlers;
return retval;
}
@@ -135,6 +136,10 @@ void msgformat_register_class( TSRMLS_D )
ce.create_object = MessageFormatter_object_create;
MessageFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ memcpy(&MessageFormatter_handlers, zend_get_std_object_handlers(),
+ sizeof MessageFormatter_handlers);
+ MessageFormatter_handlers.clone_obj = NULL;
+
/* Declare 'MessageFormatter' class properties. */
if( !MessageFormatter_ce_ptr )
{