mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fixed bug #79282
This commit is contained in:
parent
aa88f33f7d
commit
b9d32197cb
@ -3677,6 +3677,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;
|
||||
@ -3829,7 +3834,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. */
|
||||
|
15
ext/exif/tests/bug79282.phpt
Normal file
15
ext/exif/tests/bug79282.phpt
Normal file
@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #79282: Use-of-uninitialized-value in exif
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data://image/jpeg;base64,/9jhAAlFeGlmAAAg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(): Invalid TIFF alignment marker in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid JPEG file in %s on line %d
|
||||
bool(false)
|
Loading…
Reference in New Issue
Block a user