diff options
author | Gustavo Lopes <glopes@nebm.ist.utl.pt> | 2012-08-21 23:21:59 +0200 |
---|---|---|
committer | Gustavo Lopes <glopes@nebm.ist.utl.pt> | 2012-08-22 22:32:51 +0200 |
commit | a5d0c1e21b9fa166d8fe5ec7d52a24a5f7adc107 (patch) | |
tree | 2ed39a52ede3d5e9dce93ffa5e0b1aff39698b69 /ext/intl/msgformat/msgformat_class.h | |
parent | e5bdd2c0eeab50dc1f863dae9a32d3857ece6a79 (diff) | |
download | php-git-a5d0c1e21b9fa166d8fe5ec7d52a24a5f7adc107.tar.gz |
Fix handling of several uinitialized intl objects
Diffstat (limited to 'ext/intl/msgformat/msgformat_class.h')
-rw-r--r-- | ext/intl/msgformat/msgformat_class.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h index b6b8e33226..337e04e647 100644 --- a/ext/intl/msgformat/msgformat_class.h +++ b/ext/intl/msgformat/msgformat_class.h @@ -37,7 +37,15 @@ extern zend_class_entry *MessageFormatter_ce_ptr; /* Auxiliary macros */ #define MSG_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(MessageFormatter, mfo) -#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT \ + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (MSG_FORMAT_OBJECT(mfo) == NULL) { \ + intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48 |