From 76d9064cc7b4b6bc8769c9e93a654f0f51a3abae Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 21 May 2008 12:01:55 +0000 Subject: [PATCH] use ZEND_U_CONVERTER() macro to prevent segfaults when the converter is not set (i.e. NULL) --- ext/session/mod_files.c | 2 +- ext/sysvmsg/sysvmsg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 2f64c8e5dc..e4e15974d1 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -127,7 +127,7 @@ static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, cons int newlen; UErrorCode status = U_ZERO_ERROR; - zend_convert_encodings(UG(filesystem_encoding_conv), UG(utf8_conv), &newbuf, &newlen, buf, n, &status); + zend_convert_encodings(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)), UG(utf8_conv), &newbuf, &newlen, buf, n, &status); if (status != U_ZERO_ERROR) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failure converting savepath to local filesystem encoding, attempting to use utf8"); diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index 9de82a2eee..b1e1c08a62 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -413,7 +413,7 @@ PHP_FUNCTION(msg_send) char *p = NULL; switch (Z_TYPE_P(message)) { case IS_UNICODE: - if (SUCCESS != zend_unicode_to_string(UG(runtime_encoding_conv), &p, &message_len, Z_USTRVAL_P(message), Z_USTRLEN_P(message) TSRMLS_CC)) { + if (SUCCESS != zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &p, &message_len, Z_USTRVAL_P(message), Z_USTRLEN_P(message) TSRMLS_CC)) { RETURN_FALSE; } break; -- 2.50.1