]> granicus.if.org Git - php/commitdiff
use ZEND_U_CONVERTER() macro to prevent segfaults when the converter is not set ...
authorAntony Dovgal <tony2001@php.net>
Wed, 21 May 2008 12:01:55 +0000 (12:01 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 21 May 2008 12:01:55 +0000 (12:01 +0000)
ext/session/mod_files.c
ext/sysvmsg/sysvmsg.c

index 2f64c8e5dc1eb24524bc96a9de0d590567a170b9..e4e15974d1c0289edb8b3a2fd480669ae9e9b5cc 100644 (file)
@@ -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");
index 9de82a2eeedde4cb4dd3a417b4bca13700b59abe..b1e1c08a62d9d4751f06617dc1aeb4ce05a0e67b 100644 (file)
@@ -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;