]> granicus.if.org Git - php/commitdiff
Fix string extension in negate_num_string
authorNikita Popov <nikic@php.net>
Wed, 21 Dec 2016 21:11:17 +0000 (22:11 +0100)
committerNikita Popov <nikic@php.net>
Wed, 21 Dec 2016 21:11:17 +0000 (22:11 +0100)
Forgot to actually assign the reallocated string...

Zend/zend_compile.c

index c8f2eefa7d2eca008b1bea579d257817494cdc8f..14ed6a7435d5d5d1c1cc7ad8026496e369d5538b 100644 (file)
@@ -1842,7 +1842,7 @@ zend_ast *zend_negate_num_string(zend_ast *ast) /* {{{ */
                }
        } else if (Z_TYPE_P(zv) == IS_STRING) {
                size_t orig_len = Z_STRLEN_P(zv);
-               zend_string_extend(Z_STR_P(zv), orig_len + 1, 0);
+               Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), orig_len + 1, 0);
                memmove(Z_STRVAL_P(zv) + 1, Z_STRVAL_P(zv), orig_len + 1);
                Z_STRVAL_P(zv)[0] = '-';
        } else {