Commit Graph

49757 Commits

Author SHA1 Message Date
Nikita Popov
1a184f030a Commit regenerated var_unserializer.c 2019-09-23 13:47:05 +02:00
Nikita Popov
f53af9ac23 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-23 13:18:39 +02:00
Nikita Popov
8509970e6a Fix signed integer overflow in SplObjectStorage unserialization
If count is ZEND_LONG_MIN the count-- loop underflows. This is
ultimately harmless, but results in a ubsan warning.

Fix this by adding a sanity check that the count isn't negative,
because that doesn't make sense...
2019-09-23 13:18:27 +02:00
Nikita Popov
e65adc9c19 Fix ubsan violation in parse_iv2
This fixes two issues:
 * Negative the value in an unsigned type to avoid signed overflow.
 * Treat -0 as 0 rather than an invalid number that gets converted
   to ZEND_LONG_MIN.
2019-09-23 13:08:44 +02:00
Christoph M. Becker
9c89f43d55 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test to be skipped if dom is not available
2019-09-22 18:42:40 +02:00
Christoph M. Becker
697945aa89 Fix test to be skipped if dom is not available 2019-09-22 18:42:02 +02:00
Nikita Popov
9cd365e571 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-22 12:10:42 +02:00
Nikita Popov
f989a4cd44 Fix leak of temporary buffer during exif tag reading 2019-09-22 12:10:17 +02:00
Nikita Popov
623d897998 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-22 10:26:57 +02:00
Nikita Popov
0701835c01 Fix multiple leaks in exif_read_data()
This fixes two leaks related to duplicate tags, as well as a leak
of zero-length FMT_(S)BYTE with non-null value. This can show up
for MAKERNOTE values where the original length is non-zero, but
the first character is a null byte.
2019-09-21 20:40:03 +02:00
Christoph M. Becker
33e556fab4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix length of key passed to zend_hash_str_find_ptr
2019-09-21 18:12:27 +02:00
Jinesh Patel
0d6c2448a7 Fix length of key passed to zend_hash_str_find_ptr 2019-09-21 18:11:21 +02:00
Christoph M. Becker
698088ca7c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78579: mb_decode_numericentity: args number inconsistency
2019-09-21 16:16:52 +02:00
Christoph M. Becker
398b308316 Fix #78579: mb_decode_numericentity: args number inconsistency
mb_decode_numericentity() accepts a fourth optional parameter, which is
unused, however.  Since this parameter doesn't do any harm, and to avoid
the small BC break, we're keeping this parameter for PHP 7, but adjust
the arginfo.

For PHP 8, we will remove this parameter.
2019-09-21 16:15:23 +02:00
Nikita Popov
e76dea4283 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-19 21:14:40 +02:00
Nikita Popov
0fa13028cb Fix out-of-bounds read in exif tag reading
This issue was recently introduced in c739023a50,
when the restriction that components>0 has been relaxed. We now need
to make sure that any tags that expect at least one component check
that this is the case.
2019-09-19 21:11:57 +02:00
Nikita Popov
85e7668129 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-19 17:21:45 +02:00
Nikita Popov
003c13d7bc Fix iterable return type optimization 2019-09-19 17:21:00 +02:00
Nikita Popov
6bf5c8508a Merge branch 'PHP-7.2' into PHP-7.3 2019-09-19 14:20:04 +02:00
Nikita Popov
3e139a4653 Fix exif leak on duplicate copyright tags 2019-09-19 14:19:31 +02:00
Nikita Popov
f53b8268d6 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-19 11:36:09 +02:00
CJDennis
e3255a4f49 Fix typo
`sizeof("data")-1` and `sizeof("date")-1` are both 4, so no change in behaviour
2019-09-19 11:36:00 +02:00
Nikita Popov
85b001974a Remove unstable test output
This may be printed in a different order, and we don't care about
it anyway.
2019-09-18 16:36:29 +02:00
Nikita Popov
e11ed02870 Fixed bug #78272
Use MAP_JIT only when running under hardened runtime, because MAP_JIT
is incompatible with fork().

The check is based on
f879e35e3e.
2019-09-18 10:41:27 +02:00
Nikita Popov
03efeda538 Backport MAP_JIT fixes from PCRE2 10.33
This is intended to fix the primary issue from bug #77260.

Prior to macOS 10.14 multiple MAP_JIT segments were not permitted,
leading to mmap failures and corresponding "no more memory" errors
on macOS 10.13.
2019-09-18 09:28:54 +02:00
Nikita Popov
409e9ea51d Merge branch 'PHP-7.2' into PHP-7.3 2019-09-17 17:34:08 +02:00
Nikita Popov
175f4f24ae Increase timeout in test 2019-09-17 17:33:46 +02:00
Nikita Popov
c5d4c45e7d Merge branch 'PHP-7.2' into PHP-7.3 2019-09-17 15:42:58 +02:00
fancyweb
e691a98c1f Fix #76342: file_get_contents waits twice specified timeout 2019-09-17 15:42:29 +02:00
Nikita Popov
f98684b06c Merge branch 'PHP-7.2' into PHP-7.3 2019-09-17 12:08:57 +02:00
Tyson Andre
29bced9521 Fix opcache return type for get_headers in zend_func_info
https://www.php.net/manual/en/function.get-headers.php#refsect1-function.get-headers-examples
shows that it will return string keys when the second argument is
non-zero. I've verified that this is the case.

This bug was there since the initial commit in c88ffa9a56.

Closes GH-4702.
2019-09-17 12:08:29 +02:00
Nikita Popov
74876f09c4 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-16 13:02:56 +02:00
Nikita Popov
8873df8e86 Fix leak in SplObjectStorage unserialization
The result of php_var_unserialize always needs to be destroyed,
even if the call failed.
2019-09-16 13:02:32 +02:00
Christoph M. Becker
da8aa4a798 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Stick with zend_long for ABI compatibility
2019-09-15 15:13:13 +02:00
Christoph M. Becker
81cefab7b0 Stick with zend_long for ABI compatibility
Cf. <https://github.com/php/php-src/pull/4700#issuecomment-531515689>.
2019-09-15 15:11:25 +02:00
Christoph M. Becker
00ad365125 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78535: auto_detect_line_endings value not parsed as bool
2019-09-14 18:47:12 +02:00
bugreportuser
fdcca93056 Fix #78535: auto_detect_line_endings value not parsed as bool 2019-09-14 18:46:09 +02:00
Nikita Popov
df982da587 Fix bug #78525
When calling free_result_buffers(), also free field metadata and
restore the mempool state to what it was before any allocations
have been made. Remove the mempool save/restore logic for the
inner result set as this is now handled on a higher level.
2019-09-13 14:37:03 +02:00
Christoph M. Becker
31f617d9bc Fix exif build
As of PHP 7.3.0 the `model` field is removed.
2019-09-12 09:13:27 +02:00
Kalle Sommer Nielsen
6f0e5a45ff Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:31:52 +03:00
Kalle Sommer Nielsen
2823e938d4 Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7) 2019-09-12 06:21:39 +03:00
Remi Collet
664b1a3f57 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:30 +02:00
Remi Collet
c43fc204b1 Raise minimal GCC version,
Test with 4.8 is OK
With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:28:35 +02:00
Christoph M. Becker
318b92dc12 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Drop regression test
2019-09-10 10:08:07 +02:00
Christoph M. Becker
bca66002f1 Drop regression test
The state returned by `sodium_crypto_generichash_init()` has to be
regarded as opaque byte string; neither its size nor its exact
structure are fixed, and actually vary for diffent libsodium versions.
Therefore we drop the test altogether.
2019-09-10 10:07:39 +02:00
Nikita Popov
3f2d5c612e Merge branch 'PHP-7.2' into PHP-7.3 2019-09-09 17:29:39 +02:00
CHU Zhaowei
1ac6b0251b Fix bug #72884 isCloneable() on SplFileObject should return false 2019-09-09 17:27:17 +02:00
Christoph M. Becker
af2033b1cd Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78510: Partially uninitialized buffer returned by sodium_crypto_generichash_init()
2019-09-09 15:31:15 +02:00
Christoph M. Becker
8ead77936e Fix #78510: Partially uninitialized buffer returned by sodium_crypto_generichash_init()
Backport jedisct1/libsodium.php@28d13bf437.
2019-09-09 15:30:28 +02:00
Christoph M. Becker
b90cd91eba Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #41997: SP call yields additional empty result set
2019-09-03 13:31:24 +02:00