diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-11-12 23:24:17 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-11-12 23:24:48 +0100 |
commit | 512b93e9d6392877ec8d6a44a2bfead5093fa0d0 (patch) | |
tree | ae43956d753c25d3757ff26184d6a0944084ccf4 | |
parent | ee50461e4b33321d4bf8b8de33a08ce3e298ba2c (diff) | |
parent | 77646d2fd939e9d6af1a8a47f8550b3f680d1456 (diff) | |
download | php-git-512b93e9d6392877ec8d6a44a2bfead5093fa0d0.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
Fix #77141: Signedness issue in SOAP when precision=-1
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/soap/php_encoding.c | 2 | ||||
-rw-r--r-- | ext/soap/tests/bugs/bug77141.phpt | 27 |
3 files changed, 30 insertions, 1 deletions
@@ -2,6 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 7.3.0RC6 +- SOAP: + . Fixed bug #77141 (Signedness issue in SOAP when precision=-1). (cmb) 08 Nov 2018 PHP 7.3.0RC5 diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 733b3e6b75..cd7ea06649 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1084,7 +1084,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo ZVAL_DOUBLE(&tmp, zval_get_double(data)); - str = (char *) safe_emalloc(EG(precision), 1, MAX_LENGTH_OF_DOUBLE + 1); + str = (char *) safe_emalloc(EG(precision) >= 0 ? EG(precision) : 17, 1, MAX_LENGTH_OF_DOUBLE + 1); php_gcvt(Z_DVAL(tmp), EG(precision), '.', 'E', str); xmlNodeSetContentLen(ret, BAD_CAST(str), strlen(str)); efree(str); diff --git a/ext/soap/tests/bugs/bug77141.phpt b/ext/soap/tests/bugs/bug77141.phpt new file mode 100644 index 0000000000..fa38cc6959 --- /dev/null +++ b/ext/soap/tests/bugs/bug77141.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #77141 (Signedness issue in SOAP when precision=-1) +--SKIPIF-- +<?php +if (!extension_loaded('soap')) die('skip soap extension not available'); +?> +--FILE-- +<?php +$soap = new \SoapClient( + null, + array( + 'location' => "http://localhost/soap.php", + 'uri' => "http://localhost/", + 'style' => SOAP_RPC, + 'trace' => true, + 'exceptions' => false, + ) +); +ini_set('precision', -1); +$soap->call(1.1); +echo $soap->__getLastRequest(); +?> +===DONE=== +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:call><param0 xsi:type="xsd:float">1.1</param0></ns1:call></SOAP-ENV:Body></SOAP-ENV:Envelope> +===DONE=== |