1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 10:12:18 +01:00

Remove duplicated length check in exif and

remove always false condition from exif

The latter condition will never trigger because otherwise the do-while loop
wouldn't have exited.

Close GH-10402
This commit is contained in:
Niels Dossche
2023-01-21 15:35:15 +01:00
committed by David Carlier
parent 23dab38fe9
commit f4dd35ea53
2 changed files with 3 additions and 11 deletions

3
NEWS
View File

@@ -21,6 +21,9 @@ PHP NEWS
. Implement GH-10217 (Use strlen() for determining the class_name length).
(Dennis Buteyn)
- Exif:
. Removed unneeded codepaths in exif_process_TIFF_in_JPEG(). (nielsdos)
- Fileinfo:
. Upgrade bundled libmagic to 5.43. (Anatol)

View File

@@ -3679,11 +3679,6 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
return;
}
if (length < 2) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Missing TIFF alignment marker");
return;
}
/* set the thumbnail stuff to nothing so we can test to see if they get set up */
if (memcmp(CharBuf, "II", 2) == 0) {
ImageInfo->motorola_intel = 0;
@@ -3810,12 +3805,6 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo)
fpos = php_stream_tell(ImageInfo->infile);
if (marker == 0xff) {
/* 0xff is legal padding, but if we get that many, something's wrong. */
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes");
return false;
}
/* Read the length of the section. */
if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
EXIF_ERRLOG_CORRUPT(ImageInfo)