Skip to content

Commit 6043e66

Browse files
committed
Merge remote-tracking branch 'origin/PHP-7.4' into PHP-7.4
2 parents 9eacd91 + 1449d49 commit 6043e66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+379
-177
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ environment:
1616
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
1717
PHP_BUILD_OBJ_DIR: c:\obj
1818
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
19-
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta1
19+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta3
2020
PHP_BUILD_CRT: vc15
2121
# ext and env setup for tests
2222
#MYSQL_TEST_PASSWD: Password12!

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,7 @@ PHP NEWS
9292
- Tidy:
9393
. Added TIDY_TAG_* constants for HTML5 elements. (cmb)
9494

95+
- WDDX:
96+
. Deprecated the WDDX extension. (cmb)
97+
9598
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

UPGRADING

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ PHP 7.4 UPGRADE NOTES
241241
possible, but unserialization yielded unusable objects.
242242
. The @param notation can now also be used to denote SQL query parameters.
243243

244+
- WDDX:
245+
. The WDDX extension has been deprecated.
246+
244247
- Zip:
245248
. The bundled libzip library has been removed. A system libzip >= 0.11 is now
246249
necessary to build the extension.
@@ -253,6 +256,14 @@ PHP 7.4 UPGRADE NOTES
253256
. MB_ONIGURUMA_VERSION specifies the version of the oniguruma library against
254257
which mbregex has been built.
255258

259+
- Socket:
260+
. Added FreeBSD-specific socket options:
261+
. SO_LABEL
262+
. SO_PEERLABEL
263+
. SO_LISTENQLIMIT
264+
. SO_LISTENQLEN
265+
. SO_USER_COOKIE
266+
256267
- Tidy:
257268
. TIDY_TAG_ARTICLE
258269
. TIDY_TAG_ASIDE

Zend/zend_constants.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
378378
ret_constant = NULL;
379379
} else {
380380
if (!zend_verify_const_access(c, scope)) {
381-
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
381+
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
382+
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
383+
}
382384
goto failure;
383385
}
384386
ret_constant = &c->value;

ext/date/php_date.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5278,21 +5278,14 @@ PHP_METHOD(DatePeriod, __wakeup)
52785278
/* {{{ date_period_read_property */
52795279
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
52805280
{
5281-
zval *zv;
52825281
if (type != BP_VAR_IS && type != BP_VAR_R) {
52835282
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
52845283
return &EG(uninitialized_zval);
52855284
}
52865285

52875286
Z_OBJPROP_P(object); /* build properties hash table */
52885287

5289-
zv = zend_std_read_property(object, member, type, cache_slot, rv);
5290-
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
5291-
/* defensive copy */
5292-
ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv));
5293-
}
5294-
5295-
return zv;
5288+
return zend_std_read_property(object, member, type, cache_slot, rv);
52965289
}
52975290
/* }}} */
52985291

ext/exif/exif.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,6 +3378,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
33783378
break;
33793379

33803380
case TAG_USERCOMMENT:
3381+
EFREE_IF(ImageInfo->UserComment);
3382+
ImageInfo->UserComment = NULL;
3383+
EFREE_IF(ImageInfo->UserCommentEncoding);
3384+
ImageInfo->UserCommentEncoding = NULL;
33813385
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
33823386
break;
33833387

ext/exif/tests/bug77564/bug77564.jpg

73 Bytes
Loading

ext/exif/tests/bug77564/bug77564.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug 77564 (Memory leak in exif_process_IFD_TAG)
3+
--SKIPIF--
4+
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5+
--FILE--
6+
<?php
7+
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
8+
?>
9+
DONE
10+
--EXPECTF--
11+
12+
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
13+
14+
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
15+
16+
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
17+
bool(false)
18+
DONE

ext/ffi/ffi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,16 @@ static void zend_ffi_cdata_write_dim(zval *object, zval *offset, zval *value) /*
11381138
{
11391139
zend_ffi_cdata *cdata = (zend_ffi_cdata*)Z_OBJ_P(object);
11401140
zend_ffi_type *type = ZEND_FFI_TYPE(cdata->type);
1141-
zend_long dim = zval_get_long(offset);
1141+
zend_long dim;
11421142
void *ptr;
11431143
zend_ffi_flags is_const;
11441144

1145+
if (offset == NULL) {
1146+
zend_throw_error(zend_ffi_exception_ce, "Cannot add next element to object of type FFI\\CData");
1147+
return;
1148+
}
1149+
1150+
dim = zval_get_long(offset);
11451151
if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) {
11461152
if (UNEXPECTED((zend_ulong)(dim) >= (zend_ulong)type->array.length)
11471153
&& (UNEXPECTED(dim < 0) || UNEXPECTED(type->array.length != 0))) {
@@ -5296,7 +5302,7 @@ void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t n
52965302
zend_ffi_parser_error("wrong type of bit field '%.*s' at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
52975303
}
52985304

5299-
if (bits->kind == ZEND_FFI_VAL_INT32 || ZEND_FFI_VAL_INT64) {
5305+
if (bits->kind == ZEND_FFI_VAL_INT32 || bits->kind == ZEND_FFI_VAL_INT64) {
53005306
if (bits->i64 < 0) {
53015307
zend_ffi_cleanup_dcl(field_dcl);
53025308
zend_ffi_parser_error("negative width in bit-field '%.*s' at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
@@ -5310,7 +5316,7 @@ void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t n
53105316
zend_ffi_cleanup_dcl(field_dcl);
53115317
zend_ffi_parser_error("width of '%.*s' exceeds its type at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
53125318
}
5313-
} else if (ZEND_FFI_VAL_UINT32 || ZEND_FFI_VAL_UINT64) {
5319+
} else if (bits->kind == ZEND_FFI_VAL_UINT32 || bits->kind == ZEND_FFI_VAL_UINT64) {
53145320
if (bits->u64 == 0) {
53155321
zend_ffi_cleanup_dcl(field_dcl);
53165322
if (name) {

ext/ffi/tests/042.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
FFI 042: Next array element
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--INI--
6+
ffi.enable=1
7+
--FILE--
8+
<?php
9+
$a = FFI::new("uint8_t[8]");
10+
$a[] = 0;
11+
?>
12+
--EXPECTF--
13+
Fatal error: Uncaught FFI\Exception: Cannot add next element to object of type FFI\CData in %s:3
14+
Stack trace:
15+
#0 {main}
16+
thrown in %s on line 3

0 commit comments

Comments
 (0)