php/php-src — pull request #134 by reeze (2012-07-17 15:22:09+00:00)
Title: Fix test fails: ext/standard/tests/general_functions/bug27678.phpt

Hi,
After commit 3e62aae1, number_format() returns string with length,
but _php_math_number_format_ex_len() didn't set string length
on nan and inf.
https://github.com/php/php-src/commit/3e62aae1b456440328af4153524e22679b84f68a#L1R1258
when function _php_math_number_format_ex_len() return without set the length.

the return value's string length is wild bits.
This *may* cause segfault when destruct the return value.

@cataphract will you take a look?

Thanks :)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000015b278d8a
0x00000001004eef51 in _zval_dtor_func (zvalue=0x100cd2ea8, __zend_filename=0x1009ad298 "Zend//zend_execute.h", __zend_lineno=87)
at zend_variables.c:35
35	CHECK_ZVAL_STRING_REL(zvalue);
(gdb) bt
#0 0x00000001004eef51 in _zval_dtor_func (zvalue=0x100cd2ea8, __zend_filename=0x1009ad298 "Zend//zend_execute.h",
__zend_lineno=87) at zend_variables.c:35

Thanks