mirror of
https://github.com/php/php-src.git
synced 2026-03-30 12:13:02 +02:00
Fixed segfault in intlgregcal_create_instance
This commit is contained in:
@@ -182,7 +182,8 @@ U_CFUNC PHP_FUNCTION(intlgregcal_create_instance)
|
||||
_php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
|
||||
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
|
||||
zend_object_store_ctor_failed(Z_OBJ(orig) TSRMLS_CC);
|
||||
zval_dtor(&orig);
|
||||
RETURN_NULL();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ typedef struct _intl_data {
|
||||
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
|
||||
{ \
|
||||
intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
|
||||
/* yes, this is ugly, but it alreay is */ \
|
||||
if (return_value != getThis()) { \
|
||||
zval_dtor(return_value); \
|
||||
RETURN_NULL(); \
|
||||
} \
|
||||
Z_OBJ_P(return_value) = NULL; \
|
||||
return; \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user