Fix bug #68113 (Heap corruption in exif_thumbnail())

This commit is contained in:
Stanislav Malyshev 2014-09-28 16:57:42 -07:00
parent 81b67937e4
commit 4a38cc0a3c
3 changed files with 19 additions and 2 deletions

View file

@ -2413,11 +2413,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
data_ptr += 8;
break;
case TAG_FMT_SINGLE:
memmove(data_ptr, &info_data->value.f, byte_count);
memmove(data_ptr, &info_value->f, 4);
data_ptr += 4;
break;
case TAG_FMT_DOUBLE:
memmove(data_ptr, &info_data->value.d, byte_count);
memmove(data_ptr, &info_value->d, 8);
data_ptr += 8;
break;
}

BIN
ext/exif/tests/bug68113.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

View file

@ -0,0 +1,17 @@
--TEST--
Bug #68113 (Heap corruption in exif_thumbnail())
--SKIPIF--
<?php
extension_loaded("exif") or die("skip need exif");
?>
--FILE--
<?php
var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
?>
Done
--EXPECTF--
Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
bool(false)
Done