mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed segfault in intlgregcal_create_instance
This commit is contained in:
parent
f096bc4d86
commit
499293449b
2 changed files with 7 additions and 1 deletions
|
@ -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; \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue