Compare commits

...
18 Commits
Author SHA1 Message Date
Anatol Belski 8a79ce6c8b [ci skip] fix encoding 2017-07-05 12:29:03 +02:00
Anatol Belski 183599b86e sync NEWS 2017-07-05 12:15:11 +02:00
Remi Collet 77c18bc3f4 Adapt for 32-bits which fails at different offset (49 vs 38)
(cherry picked from commit 4b38feabe7)
2017-07-05 10:11:59 +02:00
Stanislav Malyshev 24494f983e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix tests

(cherry picked from commit f76a6cd023)
2017-07-05 10:11:32 +02:00
Stanislav Malyshev 203a9a61a2 Fix wddx
(cherry picked from commit 6b18d956de)
2017-07-05 10:11:12 +02:00
Stanislav Malyshev 448b8d573f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807

(cherry picked from commit 0496f5407f)
2017-07-05 10:11:02 +02:00
Nikita Popov cab5ef5355 Fixed bug #74111
(cherry picked from commit 3a25a56a92)
2017-07-05 10:10:49 +02:00
Stanislav Malyshev 5e255e9003 Fix bug #74603 - use correct buffer size
(cherry picked from commit 0525574913)
2017-07-05 10:10:39 +02:00
Stanislav Malyshev b954afea12 Fix bug #74651 - check EVP_SealInit as it can return -1
(cherry picked from commit 73cabfedf5)
2017-07-05 10:10:29 +02:00
Anatol Belski b99ff1439d fix datatype
(cherry picked from commit a29264eb8c)
2017-07-05 10:10:15 +02:00
Anatol Belski ba297e366b set versions 2017-07-04 12:26:55 +02:00
Anatol Belski 5123ffdad6 sync NEWS 2017-07-04 12:25:54 +02:00
Nikita Popov f32e3d54e4 Fixed bug #74101 and bug #74614
(cherry picked from commit d02f953faf)
2017-07-04 12:04:21 +02:00
Stanislav Malyshev 5189e43b6d Fix bug #73634 - grapheme_strpos illegal memory access
(cherry picked from commit 18b6de7a91)
2017-06-21 16:52:14 +02:00
Stanislav Malyshev e2021d41f7 Fix bug #73648 - integer overflow in substr
(cherry picked from commit 14c422a32f)
2017-06-21 16:51:51 +02:00
Anatol Belski 25ccae2b9e fix version 2017-06-20 17:03:11 +02:00
Anatol Belski b9e2520142 Split requested size as expected by CreateFileMapping.
Thus fixing ext\opcache\tests\log_verbosity_bug.phpt fails on 64-bit.

(cherry picked from commit 6a854e2740)
2017-06-20 16:26:38 +02:00
Anatol Belski d37583f95a set versions 2017-06-20 14:25:24 +02:00
30 changed files with 6648 additions and 7404 deletions

No files matched your search

+22 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017 PHP 7.0.21
06 Jul 2017 PHP 7.0.21
- Core:
. Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly
@@ -8,14 +8,26 @@ PHP NEWS
. Fixed bug #74658 (Undefined constants in array properties result in broken
properties). (Laruence)
. Fixed misparsing of abstract unix domain socket names. (Sara)
. Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
zval_get_type). (Nikita)
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
unserialize). (Nikita)
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
(Stas)
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
php_parse_date()). (Derick)
- DOM:
. Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
- GD:
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
- Intl:
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
. Fixed bug #74705 (Wrong reflection on Collator::getSortKey and
collator_get_sort_key). (Tyson Andre, Remi)
. Fixed bug #73634 (grapheme_strpos illegal memory access). (Stas)
- Mbstring:
. Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227,
@@ -28,6 +40,14 @@ PHP NEWS
. Fixed bug #74663 (Segfault with opcache.memory_protect and
validate_timestamp). (Laruence)
- OpenSSL:
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
(Stas)
- PCRE:
. Fixed bug #74087 (Segmentation fault in PHP7.1.1(compiled using the bundled PCRE library)).
(Stas)
- PDO_OCI:
. Support Instant Client 12.2 in --with-pdo-oci configure option.
(Tianfang Yang)
@@ -43,6 +63,7 @@ PHP NEWS
- Standard:
. Fixed bug #74708 (Invalid Reflection signatures for random_bytes and
random_int). (Tyson Andre, Remi)
. Fixed bug #73648 (Heap buffer overflow in substr). (Stas)
- FTP:
. Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
+1
View File
@@ -0,0 +1 @@
0=0&~2000000000
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
--SKIPIF--
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for 32-bit only');
--FILE--
<?php
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
?>
--EXPECT--
array(1) {
[0]=>
string(1) "0"
}
+1 -1
View File
@@ -55,7 +55,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
int i_result;
int i_op1, i_op2;
int str_len;
char str_result[MAX_LENGTH_OF_LONG];
char str_result[MAX_LENGTH_OF_LONG+1];
i_op1 = atoi(Z_STRVAL_P(op1));
zend_string_free(Z_STR_P(op1));
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=21
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+5949 -6853
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -899,7 +899,7 @@ datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
datenoday = monthtext ([ .\t-])* year4;
datenodayrev = year4 ([ .\t-])* monthtext;
datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year;
datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*;
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
datenoyearrev = day ([ .\t-])* monthtext;
datenocolon = year4 monthlz daylz;
+2 -2
View File
@@ -34,14 +34,14 @@ foreach ( $tests as $start => $data )
echo "\n";
?>
--EXPECT--
Sat, 23 Oct 2010 00:00:00 +0000
Fri, 15 Oct 2010 23:00:00 +0000
Wed, 15 Dec 2010 16:15:00 +0000
Mon, 20 Dec 2010 00:00:00 +0000
Mon, 20 Dec 2010 10:00:00 +0000
Tue, 21 Dec 2010 12:00:00 +0000
Mon, 03 Jan 2011 00:00:00 +0000
Mon, 03 Jan 2011 09:00:00 +0000
Sat, 23 Oct 2010 00:00:00 +0100
Fri, 15 Oct 2010 23:00:00 +0100
Sun, 28 Mar 2010 00:15:00 +0000
Sun, 28 Mar 2010 02:15:00 +0100
Sun, 28 Mar 2010 02:15:00 +0100
+3
View File
@@ -147,6 +147,9 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
int haveGlobalColormap;
gdImagePtr im = 0;
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
memset(localColorMap, 0, 3 * MAXCOLORMAPSIZE);
/*1.4//imageNumber = 1; */
if (! ReadOK(fd,buf,6)) {
return 0;
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #74435 (Buffer over-read into uninitialized memory)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
var_dump($im);
$width = imagesx($im);
$height = imagesy($im);
for ($i = 0; $i < $width; $i += 16) {
for ($j = 0; $j < $height; $j += 16) {
if (($index = imagecolorat($im, $i, $j)) >= 2) {
list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
echo "unexpected color at ($i, $j)\n";
}
}
}
}
?>
===DONE===
--EXPECTF--
resource(%d) of type (gd)
===DONE===
+2 -1
View File
@@ -110,7 +110,8 @@ PHP_FUNCTION(grapheme_strpos)
size_t haystack_len, needle_len;
const char *found;
zend_long loffset = 0;
int32_t offset = 0, noffset = 0;
int32_t offset = 0;
size_t noffset = 0;
zend_long ret_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) {
+3 -1
View File
@@ -211,8 +211,10 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
*/
#if defined(_WIN64)
void *vista_mapping_base_set[] = { (void *) 0x0000100000000000, (void *) 0x0000200000000000, (void *) 0x0000300000000000, (void *) 0x0000700000000000, 0 };
DWORD size_high = (requested_size >> 32), size_low = (requested_size & 0xffffffff);
#else
void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 };
DWORD size_high = 0, size_low = requested_size;
#endif
void **wanted_mapping_base = default_mapping_base_set;
@@ -265,7 +267,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
shared_segment = (zend_shared_segment *)((char *)(*shared_segments_p) + sizeof(void *));
(*shared_segments_p)[0] = shared_segment;
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, requested_size,
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, size_high, size_low,
create_name_with_username(ACCEL_FILEMAP_NAME));
if (memfile == NULL) {
err = GetLastError();
+1 -1
View File
@@ -5421,7 +5421,7 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx));
EVP_CIPHER_CTX_cleanup(ctx);
if (!EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
if (EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) <= 0 ||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
RETVAL_FALSE;
+27
View File
@@ -0,0 +1,27 @@
-----BEGIN CERTIFICATE-----
MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEFhMCUk8x
EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
AAOBjQAwgYkCgYEApNj7XXz8T8FcLIWpBniPYom3QcT6T7u0xRPHqtqzj5oboBYp
DJe5d354/y0gJTpiLt8+fTrPgWXnbHm3pOHgXzTcX6Arani0GDU0/xDi4VkCRGcS
YqX2sJpcDzAbmK9UDMt3xf/O1B8AJan3RfO0Bm3ozTEPziLMkmsiYr5b/L4CAwEA
AaOCAfwwggH4MAkGA1UdEwQCMAAwNQYJYIZIAYb4QgENBCgWJkZvciBHcmlkIHVz
ZSBvbmx5OyByZXF1ZXN0IHRhZyB1c2VyVGFnMBEGCWCGSAGG+EIBAQQEAwIF4DA/
BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vbW9iaWxlLmJsdWUtc29mdHdhcmUucm86
OTAvY2EvY3JsLnNodG1sMDUGCWCGSAGG+EIBCAQoFiZodHRwOi8vbW9iaWxlLmJs
dWUtc29mdHdhcmUucm86OTAvcHViLzAhBgNVHREEGjAYgRZzZXJnaXVAYmx1ZXNv
ZnR3YXJlLnJvMB0GA1UdDgQWBBSwp//5QRXeIzm93TEPl6CyonTg/DCBpwYDVR0j
BIGfMIGcoYGWpIGTMIGQMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9tYW5pYTEQ
MA4GA1UEBxMHQ3JhaW92YTEPMA0GA1UEChMGU2VyZ2l1MRMwEQYDVQQLEwpTZXJn
aXUgU1JMMRIwEAYDVQQDEwlTZXJnaXUgQ0ExIzAhBgkqhkiG9w0BCQEWFG5fc2Vy
Z2l1QGhvdG1haWwuY29tggEAMAsGA1UdDwQEAwIE8DAjBglghkgBhvhCAQIEFhYU
aHR0cDovLzYyLjIzMS45OC41Mi8wCwYDKgMEBAQ+52I0MA0GCSqGSIb3DQEBBAUA
A4GBAIBIOJ+iiLyQfNJEY+IMefayQea0nmuXYY+F+L1DFjSC7xChytgYoPNnKkhh
3dWPtxbswiqKYUnGi6y3Hi4UhDsOaDW29t2S305hSc2qgjOiNtRYQIVYQ8EHG1k7
Fl63S7uCOhnVJt+4MnUK1N6/pwgsp+Z2GvEsDG1qCKnvNpf6
-----END CERTIFICATE-----
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #74651: negative-size-param (-1) in memcpy in zif_openssl_seal()
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?php
$inputstr = file_get_contents(__DIR__ . "/74651.pem");
$pub_key_id = openssl_get_publickey($inputstr);
var_dump($pub_key_id);
var_dump(openssl_seal($inputstr, $sealed, $ekeys, array($pub_key_id, $pub_key_id), 'AES-128-ECB'));
?>
--EXPECTF--
resource(%d) of type (OpenSSL key)
bool(false)
+1 -1
View File
@@ -7307,7 +7307,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
if (*matchingpath == OP_FAIL)
stacksize = 0;
if (*matchingpath == OP_RREF)
else if (*matchingpath == OP_RREF)
{
stacksize = GET2(matchingpath, 1);
if (common->currententry == NULL)
+6 -6
View File
@@ -165,7 +165,7 @@ static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen)
int is_letter = ((unsigned int) ((l - 'A') ^ (l - 'F' - 1))) >> (8 * sizeof(unsigned int) - 1);
unsigned char d;
/* basically (c >= '0' && c <= '9') || (l >= 'A' && l <= 'F') */
/* basically (c >= '0' && c <= '9') || (l >= 'A' && l <= 'F') */
if (EXPECTED((((c ^ '0') - 10) >> (8 * sizeof(unsigned int) - 1)) | is_letter)) {
d = (l - 0x10 - 0x27 * is_letter) << 4;
} else {
@@ -2371,7 +2371,7 @@ PHP_FUNCTION(substr)
RETURN_FALSE;
}
if ((f + l) > (zend_long)ZSTR_LEN(str)) {
if ((size_t)l > ZSTR_LEN(str) - (size_t)f) {
l = ZSTR_LEN(str) - f;
}
@@ -2842,7 +2842,7 @@ PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size
for (i = 0; i < trlen; i++) {
xlat[(size_t)(unsigned char) str_from[i]] = str_to[i];
}
for (i = 0; i < len; i++) {
str[i] = xlat[(size_t)(unsigned char) str[i]];
}
@@ -3235,7 +3235,7 @@ static zend_string *php_str_to_str_i_ex(zend_string *haystack, char *lc_haystack
zend_string_release(lc_needle);
goto nothing_todo;
}
if (str_len > ZSTR_LEN(lc_needle)) {
new_str = zend_string_safe_alloc(count, str_len - ZSTR_LEN(lc_needle), ZSTR_LEN(haystack), 0);
} else {
@@ -3398,7 +3398,7 @@ PHP_FUNCTION(strtr)
ZVAL_LONG(&tmp, num_key);
convert_to_string(&tmp);
str_key = Z_STR(tmp);
}
}
replace = zval_get_string(entry);
if (ZSTR_LEN(str_key) < 1) {
RETVAL_STR_COPY(str);
@@ -3961,7 +3961,7 @@ static zend_long php_str_replace_in_subject(zval *search, zval *replace, zval *s
zend_string_release(lc_subject_str);
lc_subject_str = NULL;
}
}
}
}
zend_string_release(search_str);
+1 -1
View File
@@ -42,7 +42,7 @@ bool(false)
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
bool(false)
Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d
Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
bool(false)
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
@@ -0,0 +1,10 @@
--TEST--
Bug #74101: Unserialize Heap Use-After-Free (READ: 1) in zval_get_type
--FILE--
<?php
$s = 'O:9:"Exception":799999999999999999999999999997:0i:0;a:0:{}i:2;i:0;i:0;R:2;';
var_dump(unserialize($s));
?>
--EXPECTF--
Notice: unserialize(): Error at offset 48 of 74 bytes in %s on line %d
bool(false)
@@ -0,0 +1,10 @@
--TEST--
Bug #74111: Heap buffer overread (READ: 1) finish_nested_data from unserialize
--FILE--
<?php
$s = 'O:8:"stdClass":00000000';
var_dump(unserialize($s));
?>
--EXPECTF--
Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
bool(false)
@@ -0,0 +1,10 @@
--TEST--
Bug #74614: Use-after-free in PHP7's unserialize()
--FILE--
<?php
unserialize('a:3020000000000000000000000000000001:{i:0;a:0:{}i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;i:7;i:8;i:8;R:2;}');
?>
--EXPECTF--
Notice: unserialize(): Error at offset %d of 113 bytes in %s on line %d
+1 -1
View File
@@ -48,7 +48,7 @@ DONE
--EXPECTF--
Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d
Notice: unserialize(): Error at offset 17 of 17 bytes in %sbug70436.php on line %d
Notice: unserialize(): Error at offset 16 of 17 bytes in %sbug70436.php on line %d
Notice: unserialize(): Error at offset 93 of 94 bytes in %sbug70436.php on line %d
bool(false)
+1 -1
View File
@@ -14,5 +14,5 @@ unserialize($poc);
?>
DONE
--EXPECTF--
Notice: unserialize(): Error at offset 51 of 50 bytes in %sbug72663_3.php on line %d
Notice: unserialize(): Error at offset 50 of 50 bytes in %sbug72663_3.php on line %d
DONE
File diff suppressed because it is too large. Load diff
+12 -9
View File
@@ -432,13 +432,12 @@ string_key:
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
{
if (*((*p)++) == '}')
return 1;
if (*p >= max || **p != '}') {
return 0;
}
#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
zval_ptr_dtor(rval);
#endif
return 0;
(*p)++;
return 1;
}
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
@@ -507,6 +506,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
&& zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1);
ht = Z_OBJPROP_P(rval);
if (elements >= HT_MAX_SIZE - zend_hash_num_elements(ht)) {
return 0;
}
zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, (ht->u.flags & HASH_FLAG_PACKED));
if (!process_nested_data(UNSERIALIZE_PASSTHRU, ht, elements, 1)) {
if (has_wakeup) {
@@ -769,7 +772,7 @@ use_double:
*p = YYCURSOR;
if (!var_hash) return 0;
if (elements < 0) {
if (elements < 0 || elements >= HT_MAX_SIZE) {
return 0;
}
@@ -788,11 +791,11 @@ use_double:
}
"o:" iv ":" ["] {
long elements;
zend_long elements;
if (!var_hash) return 0;
elements = object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR);
if (elements < 0) {
if (elements < 0 || elements >= HT_MAX_SIZE) {
return 0;
}
return object_common2(UNSERIALIZE_PASSTHRU, elements);
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #74145 (wddx parsing empty boolean tag leads to SIGSEGV)
--SKIPIF--
<?php
if (!extension_loaded("wddx")) print "skip";
?>
--FILE--
<?php
$data = file_get_contents(__DIR__ . '/bug74145.xml');
$wddx = wddx_deserialize($data);
var_dump($wddx);
?>
DONE
--EXPECTF--
NULL
DONE
+9
View File
@@ -0,0 +1,9 @@
<?xml version='1.0' ?>
<!DOCTYPE et SYSTEM 'w'>
<wddxPacket ven='1.0'>
<array>
<var Name="name">
<boolean ></boolean>
</var>
</array>
</wddxPacket>
+2 -5
View File
@@ -758,19 +758,16 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
} else if (!strcmp((char *)name, EL_BOOLEAN)) {
int i;
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
if (atts) for (i = 0; atts[i]; i++) {
if (!strcmp((char *)atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
ZVAL_TRUE(&ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
php_wddx_process_data(user_data, atts[i+1], strlen((char *)atts[i+1]));
break;
}
} else {
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
ZVAL_FALSE(&ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
}
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_RELEASE_VERSION 21
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.0.21-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.0.21"
#define PHP_VERSION_ID 70021