summaryrefslogtreecommitdiff
path: root/ext/exif/exif.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2020-03-15 17:26:00 -0700
committerStanislav Malyshev <stas@php.net>2020-03-16 22:40:00 -0700
commit25238bdf6005b85ab844aa2b743b589dfce9f0d2 (patch)
tree1d1b49471669226df55692bdcf263801a31b447d /ext/exif/exif.c
parent1fdffd1c55d771ca22ae217784ab75fce592ad38 (diff)
downloadphp-git-25238bdf6005b85ab844aa2b743b589dfce9f0d2.tar.gz
Fixed bug #79282
Diffstat (limited to 'ext/exif/exif.c')
-rw-r--r--ext/exif/exif.c7
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. */