]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1' into PHP-7.2
authorStanislav Malyshev <stas@php.net>
Mon, 4 Mar 2019 06:20:35 +0000 (22:20 -0800)
committerStanislav Malyshev <stas@php.net>
Mon, 4 Mar 2019 06:20:35 +0000 (22:20 -0800)
* PHP-7.1:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename

1  2 
ext/exif/exif.c
ext/phar/phar.c
ext/spl/spl_directory.c

diff --cc ext/exif/exif.c
index 9c202196c66c3d5fe6fb8f959e3ea0d36036f1db,fe89b854711879274555bdc762ea6e7fa518fa59..f5bc98a226d43aa6135d2da48942ae0ccbc5664d
@@@ -3204,9 -2792,9 +3204,10 @@@ static int exif_process_IFD_in_MAKERNOT
                        offset_base = value_ptr + offset_diff;
                        data_len = value_len - offset_diff;
                        break;
 +#endif
                default:
                case MN_OFFSET_NORMAL:
+                       data_len = value_len;
                        break;
        }
  
@@@ -4682,16 -4182,18 +4687,18 @@@ PHP_FUNCTION(exif_thumbnail
        ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
        if (arg_c >= 3) {
                if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
-                       exif_scan_thumbnail(&ImageInfo);
+                       if (!exif_scan_thumbnail(&ImageInfo)) {
+                               ImageInfo.Thumbnail.width = ImageInfo.Thumbnail.height = 0;
+                       }
                }
 -              zval_dtor(p_width);
 -              zval_dtor(p_height);
 -              ZVAL_LONG(p_width,  ImageInfo.Thumbnail.width);
 -              ZVAL_LONG(p_height, ImageInfo.Thumbnail.height);
 +              zval_dtor(z_width);
 +              zval_dtor(z_height);
 +              ZVAL_LONG(z_width,  ImageInfo.Thumbnail.width);
 +              ZVAL_LONG(z_height, ImageInfo.Thumbnail.height);
        }
        if (arg_c >= 4) {
 -              zval_dtor(p_imagetype);
 -              ZVAL_LONG(p_imagetype, ImageInfo.Thumbnail.filetype);
 +              zval_dtor(z_imagetype);
 +              ZVAL_LONG(z_imagetype, ImageInfo.Thumbnail.filetype);
        }
  
  #ifdef EXIF_DEBUG
diff --cc ext/phar/phar.c
Simple merge
Simple merge