summaryrefslogtreecommitdiff
path: root/ext/exif/exif.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement a cache for exif tag name lookupsNikita Popov2019-10-181-13/+54
|
* Limit the amount of errors generated during exif parsingNikita Popov2019-10-181-1/+15
| | | | | | | Emitting errors is fairly expensive, to the point that parsing a file with a huge number of invalid tags can take seconds. Generating ten thousand errors is unlikely to help anybody, but constitutes a potential DOS vector.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-091-2/+3
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-10-091-2/+3
| |\
| | * Avoid float to int cast UB in exifNikita Popov2019-10-091-2/+3
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-091-5/+0
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-10-091-5/+0
| |\ \ | | |/
| | * Remove redundant components < 0 checkNikita Popov2019-10-091-5/+0
| | | | | | | | | | | | components is an unsigned number, it cannot be smaller than zero.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-221-0/+2
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-221-0/+2
| |\ \ | | |/
| | * Fix leak of temporary buffer during exif tag readingNikita Popov2019-09-221-0/+2
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-221-5/+4
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-221-5/+4
| |\ \ | | |/
| | * Fix multiple leaks in exif_read_data()Nikita Popov2019-09-211-5/+4
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-191-0/+20
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-191-0/+20
| |\ \ | | |/
| | * Fix out-of-bounds read in exif tag readingNikita Popov2019-09-191-0/+20
| | | | | | | | | | | | | | | | | | | | | This issue was recently introduced in c739023a50876e2a90588f915803b0140a95638e, 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.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-191-0/+4
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-191-0/+4
| |\ \ | | |/
| | * Fix exif leak on duplicate copyright tagsNikita Popov2019-09-191-0/+4
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-09-121-20/+20
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.3: Fix exif build NEWS
| * | Fix exif buildChristoph M. Becker2019-09-121-20/+20
| | | | | | | | | | | | As of PHP 7.3.0 the `model` field is removed.
* | | Merge branch 'PHP-7.3' into PHP-7.4Kalle Sommer Nielsen2019-09-121-33/+27
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
| * | Merge branch 'PHP-7.2' into PHP-7.3Kalle Sommer Nielsen2019-09-121-33/+27
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
| | * Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)Kalle Sommer Nielsen2019-09-121-16/+10
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-07-291-3/+3
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * 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)
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-07-291-3/+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)
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-07-291-3/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
| | | * Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)Stanislav Malyshev2019-07-291-3/+3
| | | |
| | | * Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)Stanislav Malyshev2019-07-291-1/+1
| | | |
| | * | Fixed bug #78333Nikita Popov2019-07-291-6/+20
| | | | | | | | | | | | | | | | | | | | Don't dereference float/double values at unknown address, instead memcpy it into an aligned stack slot and dereference that.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-291-6/+20
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-07-291-6/+20
| |\ \ \
| | * | | Fixed bug #78333Nikita Popov2019-07-291-6/+20
| | |/ / | | | | | | | | | | | | | | | | Don't dereference float/double values at unknown address, instead memcpy it into an aligned stack slot and dereference that.
* | | | Report errors from stream read and write operationsNikita Popov2019-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Simplify expression and remove the possibility of div by 0Stanislav Malyshev2019-07-071-3/+3
| | | | | | | | | | | | | | | | Maybe should use exp2() but not sure about how supported it is.
* | | | Fix shift UB in php_ifd_get32sNikita Popov2019-06-191-13/+14
| | | |
* | | | Allow exceptions in __toString()Nikita Popov2019-06-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-0/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
| * | | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-0/+2
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
| | * | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-05-271-0/+2
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.1: Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
| | | * Fix bug #77988 - heap-buffer-overflow on php_jpg_get16Stanislav Malyshev2019-05-271-0/+2
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-04-301-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
| * | | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-04-301-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
| | * | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-04-301-1/+1
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.1: Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
| | | * Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAGStanislav Malyshev2019-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function ↵Dmitry Stogov2019-04-241-3/+3
| | | | | | | | | | | | | | | | by reference
* | | | Remove dead JPEG2000 codeKalle Sommer Nielsen2019-04-021-59/+0
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Remi Collet2019-04-021-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: fix paste issue
| * | | Merge branch 'PHP-7.2' into PHP-7.3Remi Collet2019-04-021-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: fix paste issue