From: Antony Dovgal Date: Thu, 21 Dec 2006 00:25:58 +0000 (+0000) Subject: bail out if zend_unicode_to_string() fails X-Git-Tag: RELEASE_1_0_0RC1~590 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5e986519783cc1251a7789c4214672f2dfcdb6d;p=php bail out if zend_unicode_to_string() fails --- diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 9f2466636f..fd07b9eda3 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -106,11 +106,16 @@ PHP_FUNCTION(strptime) char *temp; int temp_len; - zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &temp, &temp_len, ts.u, ts_length TSRMLS_CC); + if (zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &temp, &temp_len, ts.u, ts_length TSRMLS_CC) == FAILURE) { + RETURN_FALSE; + } ts.s = temp; ts_length = temp_len; - zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &temp, &temp_len, format.u, format_length TSRMLS_CC); + if (zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &temp, &temp_len, format.u, format_length TSRMLS_CC) == FAILURE) { + efree(ts.s); + RETURN_FALSE; + } format.s = temp; format_length = temp_len; }