diff options
author | Stanislav Malyshev <stas@php.net> | 2020-03-15 17:26:00 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2020-03-16 22:40:00 -0700 |
commit | 25238bdf6005b85ab844aa2b743b589dfce9f0d2 (patch) | |
tree | 1d1b49471669226df55692bdcf263801a31b447d /ext/exif/exif.c | |
parent | 1fdffd1c55d771ca22ae217784ab75fce592ad38 (diff) | |
download | php-git-25238bdf6005b85ab844aa2b743b589dfce9f0d2.tar.gz |
Fixed bug #79282
Diffstat (limited to 'ext/exif/exif.c')
-rw-r--r-- | ext/exif/exif.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index f6dd08e881..95d8fc9e45 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3665,6 +3665,11 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, { unsigned exif_value_2a, offset_of_ifd; + 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; @@ -3817,7 +3822,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo) return FALSE; } - sn = exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL); + sn = exif_file_sections_add(ImageInfo, marker, itemlen, NULL); Data = ImageInfo->file.list[sn].data; /* Store first two pre-read bytes. */ |