Commit graph

611 commits

Author SHA1 Message Date
Nikita Popov
6a21804b83 Merge branch 'PHP-7.4' 2019-09-19 21:14:54 +02:00
Nikita Popov
f0f84adf2b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 21:14:46 +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
975ef6ea9c Merge branch 'PHP-7.4' 2019-09-19 14:20:38 +02:00
Nikita Popov
8a599c7b74 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 14:20:13 +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
Christoph M. Becker
b59f6e4fb1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix exif build
  NEWS
2019-09-12 09:14:27 +02:00
Christoph M. Becker
679cbee870 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix exif build
  NEWS
2019-09-12 09:14:08 +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
c2d661c2e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:34:35 +03:00
Kalle Sommer Nielsen
89227fba99 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:33:40 +03: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
Craig Duncan
743591458c Convert exif functions arginfo to php stubs
We also allow sections needed to be null.
2019-08-26 17:25:12 +02:00
Stanislav Malyshev
e043025fda Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #77919: Potential UAF in Phar RSHUTDOWN
  Update NEWS
  Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)
  Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
2019-07-29 13:20:59 -07:00
Stanislav Malyshev
4adf3dc109 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77919: Potential UAF in Phar RSHUTDOWN
  Update NEWS
  Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)
  Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
2019-07-29 13:20:52 -07:00
Stanislav Malyshev
d69894734d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77919: Potential UAF in Phar RSHUTDOWN
  Update NEWS
  Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)
  Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
2019-07-29 13:20:44 -07:00
Stanislav Malyshev
284fb08fdc Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77919: Potential UAF in Phar RSHUTDOWN
  Update NEWS
  Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)
  Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
2019-07-29 13:19:16 -07:00
Nikita Popov
68fd435ba8 Fixed bug #78333
Don't dereference float/double values at unknown address, instead
memcpy it into an aligned stack slot and dereference that.
2019-07-29 11:27:21 +02:00
Nikita Popov
2b10f6299b Merge branch 'PHP-7.4' 2019-07-29 11:26:36 +02:00
Nikita Popov
2eb159d589 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 11:26:31 +02:00
Nikita Popov
727929765b Merge branch 'PHP-7.2' into PHP-7.3 2019-07-29 11:26:09 +02:00
Nikita Popov
d142dfc93d Fixed bug #78333
Don't dereference float/double values at unknown address, instead
memcpy it into an aligned stack slot and dereference that.
2019-07-29 11:25:27 +02:00
Stanislav Malyshev
aeb6d13185 Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment) 2019-07-29 00:53:37 -07:00
Stanislav Malyshev
dea2989ab8 Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail) 2019-07-29 00:53:28 -07:00
Nikita Popov
a1e2c8870e Merge branch 'PHP-7.4' 2019-07-22 17:26:01 +02:00
Nikita Popov
d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Stanislav Malyshev
27b6d36f98 Merge branch 'PHP-7.4'
* PHP-7.4:
  Simplify expression and remove the possibility of div by 0
2019-07-07 16:21:06 -07:00
Stanislav Malyshev
57e7c3aac1 Simplify expression and remove the possibility of div by 0
Maybe should use exp2() but not sure about how supported it is.
2019-07-07 16:16:05 -07:00
Nikita Popov
3645292235 Merge branch 'PHP-7.4' 2019-06-19 15:09:39 +02:00
Nikita Popov
1c018af682 Fix shift UB in php_ifd_get32s 2019-06-19 15:09:00 +02:00
twosee
63171d88f2 Add do...while(0) for RETURN_* and ZVAL_* APIs
Closes GH-4255.
2019-06-12 16:17:16 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Stanislav Malyshev
d99de36e53 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:34 -07:00
Stanislav Malyshev
670c2ee685 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:29 -07:00
Stanislav Malyshev
13dffa9d32 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:25 -07:00
Stanislav Malyshev
dc1d99e772 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:20 -07:00
Stanislav Malyshev
73ff4193be Fix bug #77988 - heap-buffer-overflow on php_jpg_get16 2019-05-27 17:28:09 -07:00
Stanislav Malyshev
bc8822361a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:06:15 -07:00
Stanislav Malyshev
db0de953ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:06:10 -07:00
Stanislav Malyshev
66b32f25d5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:43 -07:00
Stanislav Malyshev
cb5af4e8a0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:32 -07:00
Stanislav Malyshev
f80ad18afa Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
I do not completely understand what is going on there, but I am pretty
sure dir_entry <= offset_base if not a normal situation, so we better not
to rely on such dir_entry.
2019-04-30 00:05:23 -07:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Kalle Sommer Nielsen
eb8a19c8ad Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead JPEG2000 code
2019-04-02 21:18:48 +03:00