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

Fix exif crashes

This commit is contained in:
Rasmus Lerdorf
2003-04-01 18:47:01 +00:00
parent bf0c1962d9
commit 14aa0e7495
2 changed files with 5 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ Fixed:
i18n_convert/mb_convert_encoding (Moriyoshi Koizumi)
socket_iovec_alloc (Rasmus)
exif_imagetype,exif_thumbnail (Rasmus)
Open:
@@ -14,8 +14,6 @@ Open:
array_pad
bcsub (1)
dbase_open
exif_imagetype
exif_thumbnail
mb_ereg (2)
mb_ereg_match (2)
mb_eregi (2)

View File

@@ -4012,17 +4012,9 @@ PHP_FUNCTION(exif_thumbnail)
}
convert_to_string_ex(p_name);
if (arg_c >= 3) {
zval_dtor(*p_width);
zval_dtor(*p_height);
}
if (arg_c >= 4) {
zval_dtor(*p_imagetype);
}
ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), 1, 0 TSRMLS_CC);
if (ret==FALSE) {
exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
}
@@ -4043,10 +4035,13 @@ PHP_FUNCTION(exif_thumbnail)
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
}
zval_dtor(*p_width);
zval_dtor(*p_height);
ZVAL_LONG(*p_width, ImageInfo.Thumbnail.width);
ZVAL_LONG(*p_height, ImageInfo.Thumbnail.height);
}
if (arg_c >= 4) {
zval_dtor(*p_imagetype);
ZVAL_LONG(*p_imagetype, ImageInfo.Thumbnail.filetype);
}
@@ -4076,6 +4071,7 @@ PHP_FUNCTION(exif_imagetype)
if (zend_get_parameters_ex(1, &arg1) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(arg1);
stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
if (stream == NULL) {