diff options
author | Anatol Belski <ab@php.net> | 2018-03-10 11:20:11 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-03-10 11:20:11 +0100 |
commit | cf0012dad0aa72a58928e30feabc3530d4eca6bb (patch) | |
tree | eac2ba0a41d102b96539613fc78cd667325603ea /Zend | |
parent | d4cb4168ba5eea2ed2e983cca58f076c7f492d58 (diff) | |
parent | 8417a239731158b7a8585f323e2c9216cac13c85 (diff) | |
download | php-git-cf0012dad0aa72a58928e30feabc3530d4eca6bb.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Fixed bug #76068 parse_ini_string fails to parse "[foo]\nbar=1|>baz" with segfault
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_ini_parser.y | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 00d57c5d1f..b224994214 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -57,11 +57,19 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2) int str_len; char str_result[MAX_LENGTH_OF_LONG+1]; - i_op1 = atoi(Z_STRVAL_P(op1)); - zend_string_free(Z_STR_P(op1)); + if (IS_LONG == Z_TYPE_P(op1)) { + i_op1 = Z_LVAL_P(op1); + } else { + i_op1 = atoi(Z_STRVAL_P(op1)); + zend_string_free(Z_STR_P(op1)); + } if (op2) { - i_op2 = atoi(Z_STRVAL_P(op2)); - zend_string_free(Z_STR_P(op2)); + if (IS_LONG == Z_TYPE_P(op2)) { + i_op2 = Z_LVAL_P(op2); + } else { + i_op2 = atoi(Z_STRVAL_P(op2)); + zend_string_free(Z_STR_P(op2)); + } } else { i_op2 = 0; } |