summaryrefslogtreecommitdiff
path: root/ext/exif
Commit message (Collapse)AuthorAgeFilesLines
* Review parameter names in ext/exifMáté Kocsis2020-10-023-15/+15
| | | | Closes GH-6256
* Run tidyNikita Popov2020-09-183-7/+7
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Make null byte error a ValueErrorNikita Popov2020-09-082-6/+6
| | | | | | | | | | | | | Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
* Promote warnings in exifNikita Popov2020-09-082-4/+47
| | | | | | The only thing that can promoted are the path-related checked. Everything else is input dependent and error-suppressing these functions is both the typical and the recommended usage.
* Remove some unnecessary HAVE_EXTNAME guardsNikita Popov2020-09-072-8/+0
| | | | | | | | A recurring pattern in old extension: Putting the whole source code behind HAVE_EXTNAME. This is pointless, as the code is only compiled if the extension is enabled. This removes a couple of them, but not all.
* Merge branch 'PHP-7.4'Nikita Popov2020-08-313-16/+50
|\ | | | | | | | | * PHP-7.4: Make MAX_IFD_NESTING_LEVEL an actual nesting level
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-313-16/+50
| |\ | | | | | | | | | | | | * PHP-7.3: Make MAX_IFD_NESTING_LEVEL an actual nesting level
| | * Make MAX_IFD_NESTING_LEVEL an actual nesting levelNikita Popov2020-08-313-16/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we only ever increment ifd_nesting_level, so this ends up being a limit on the total number of IFD tags and we regularly get bug reports of it being exceeded. I think the intention behind this limit was to prevent recursion stack overflow, and for that we only need to check actual recursive usage. I've implemented that here, and dropped the nesting limit down to a smaller value (which still passes our tests). However, it seems that we do also need to have a total limit on the number of tags, as we don't catch some instances of infinite looping otherwise. Add this as a separate limit with a higher value, that should hopefully be sufficient. This is expected to fix a number of bugs: https://bugs.php.net/bug.php?id=78083 https://bugs.php.net/bug.php?id=78701 https://bugs.php.net/bug.php?id=79907 https://bugs.php.net/bug.php?id=80016
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-113-9/+34
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #75785 by attempt switching endianness on Maker's Note
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-113-10/+35
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix bug #75785 by attempt switching endianness on Maker's Note
| | * Fix bug #75785 by attempt switching endianness on Maker's NoteNawarian2020-08-113-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Different manufacturer models may come with a different endianness (motorola/intel) format. In order to avoid a big refactor and a gigantic lookup table, this commit simply attempts to switch the endianness and proceed when values are acceptable. Closes GH-5849.
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-091-0/+1
| | | | | | | | | | | | Closes GH-5958
* | | Add another round of missing parameter types to stubsMáté Kocsis2020-08-072-2/+7
| | | | | | | | | | | | Closes GH-5950
* | | Add a few missing types to stubsMáté Kocsis2020-08-012-1/+3
| | |
* | | Put debug function behind ifdefNikita Popov2020-07-131-0/+2
| | |
* | | Restore warningNikita Popov2020-07-131-0/+1
| | |
* | | Fix compilation errors when EXIF_DEBUG is definedNat Wyatt2020-07-131-19/+24
| | | | | | | | | | | | | | | | | | Fix warnings and error when compiling with EXIF_DEBUG defined. Closes GH-5838.
* | | Remove proto comments from C filesMax Semenik2020-07-061-34/+17
| | | | | | | | | | | | Closes GH-5758
* | | Replace EXPECTF when possibleFabien Villepinte2020-06-295-8/+8
| | | | | | | | | | | | Closes GH-5779
* | | Remove unnecessary PHPDoc-alike blocks from testsMáté Kocsis2020-06-244-18/+0
| | | | | | | | | | | | Closes GH-5759
* | | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | | Use standard bool type in EXIF extensionGeorge Peter Banyard2020-06-231-95/+92
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-06-133-3/+32
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-133-3/+32
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
| | * Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotesChristoph M. Becker2020-06-133-3/+32
| | | | | | | | | | | | | | | | | | | | | Even if the length of a maker note does not match our expectations (either because the maker note is corrupted, or because our expectations do not quite match reality), there is no need to let parsing fail; we can still go on parsing the other meta information.
| | * Fix testStanislav Malyshev2020-03-161-1/+1
| | |
| | * Fixed bug #79282Stanislav Malyshev2020-03-162-1/+21
| | |
* | | Avoid out of range float to int cast in exifNikita Popov2020-06-121-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use convert_any_int instead of convert_any_format to directly get an integer. Also adjust SRATIONAL handling to not go through a double division. This was introduced to avoid SIGFPE for the INT_MIN / -1 case, but we can just handle that explicitly.
* | | Fix null pointer UB in add_assoc_image_info()Nikita Popov2020-06-121-134/+133
| | | | | | | | | | | | | | | And clean up this function a bit by reducing indentation and variable scope.
* | | Fix float conversion warningNikita Popov2020-06-121-1/+1
| | | | | | | | | | | | We are okay with the loss of precision here...
* | | Fix [-Wundef] warning in Filter extensionGeorge Peter Banyard2020-05-161-1/+1
| | |
* | | Fix [-Wundef] warning in EXIF extensionGeorge Peter Banyard2020-05-161-1/+1
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-04-161-9/+34
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #79336
| * | Fix bug #79336Nikita Popov2020-04-161-9/+34
| | | | | | | | | | | | Make reading of floats and doubles host-endian independent.
* | | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-6/+6
| | | | | | | | | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Generate function entries from stubs for a couple of extensionsMáté Kocsis2020-04-044-16/+18
| | | | | | | | | | | | Closes GH-5347
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-171-0/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.4: [ci skip] Update NEWS Fix test Fix bug #79329 - get_headers should not accept \0 Fixed bug #79282 Fix #79283: Segfault in libmagic patch contains a buffer overflow Fix #79371: mb_strtolower (UTF-32LE): stack-buffer-overflow [ci skip] Update NEWS Fix test Fix bug #79329 - get_headers should not accept \0 Fixed bug #79282 Fix #79371: mb_strtolower (UTF-32LE): stack-buffer-overflow
| * | Fix testStanislav Malyshev2020-03-161-1/+1
| | |
| * | Fixed bug #79282Stanislav Malyshev2020-03-162-1/+21
| | |
* | | Fix testStanislav Malyshev2020-03-161-1/+1
| | |
* | | Fixed bug #79282Stanislav Malyshev2020-03-162-1/+21
| | |
* | | Use serialize_precision for var_dump()Nikita Popov2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | var_dump() is debugging functionality, so it should print floating-point numbers accurately. We do this by switching to serialize_precision, which (by default) will print with as much precision as necessary to preserve the exact value of the float. This also affects debug_zval_dump(). Closes GH-5172.
* | | Handle EXIF offsets in a principled mannerNikita Popov2020-02-181-51/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exif_process_IFD_TAG() currently accepts a dir_entry, offset_base and IFDlength. However, it's very hard to follow how these values are related to each other and the addressable memory region. As we add additional bounds check, this gets further confused. One of the basic cases is where dir_entry is in [offset_base, offset_base+IFDlength), in which case the memory [dir_entry, offset_base+IFDlength) is valid, but the memory [offset_base, dir_entry) is not necessarily valid. I wasn't able to understand what exactly is valid if dir_entry is outside [offset_base, offset_base+IFDlength) This patch changes everything to use a struct that separately stores offset_base and the valid memory region and adds helpers to fetch offsets and check that pointers are in-bounds. Closes GH-5068.
* | | Reindent phpt filesNikita Popov2020-02-036-20/+20
| | |
* | | Fix #78880 Another roundMáté Kocsis2020-01-191-2/+2
| | |
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-171-1/+1
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-2/+2
| | |
* | | Use ZEND_THROWS() during ZPP in enchant, exif, fileinfo, filter, and FTP ↵Máté Kocsis2019-12-311-2/+2
| | | | | | | | | | | | extensions
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-302-2/+35
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #79046
| * | Fixed bug #79046Nikita Popov2019-12-302-2/+35
| | |