]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorDmitry Stogov <dmitry@zend.com>
Mon, 17 Feb 2020 09:54:11 +0000 (12:54 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 17 Feb 2020 09:54:11 +0000 (12:54 +0300)
* PHP-7.4:
  Disable instantiation of zero size FFI\CData objects
  Fix # 79171: heap-buffer-overflow in phar_extract_file
  Fix bug #79082 - Files added to tar with Phar::buildFromIterator have all-access permissions
  Fix bug #79221 - Null Pointer Dereference in PHP Session Upload Progress

1  2 
ext/ffi/ffi.c
ext/ffi/tests/023.phpt
ext/ffi/tests/027.phpt
ext/ffi/tests/045.phpt

diff --cc ext/ffi/ffi.c
Simple merge
index 4e895d993160f6e1b3aa860990ecc51ef1943821,920a3bee3ecb6abc87e4a8399bc2e7710d380bd2..651713bf2bca7c6365f6fe259c3c4b5e47b3fb49
@@@ -6,9 -6,13 +6,13 @@@ FFI 023: GCC struct extension
  ffi.enable=1
  --FILE--
  <?php
-     var_dump(FFI::sizeof(FFI::new("struct {}")));
 -      try {
 -              var_dump(FFI::sizeof(FFI::new("struct {}")));
 -      } catch (Throwable $e) {
 -              echo get_class($e) . ": " . $e->getMessage() . "\n";
 -      }
 -      var_dump(FFI::sizeof(FFI::new("struct {int a}")));
 -      var_dump(FFI::sizeof(FFI::new("struct {int a; int b}")));
++    try {
++        var_dump(FFI::sizeof(FFI::new("struct {}")));
++    } catch (Throwable $e) {
++        echo get_class($e) . ": " . $e->getMessage() . "\n";
++    }
 +    var_dump(FFI::sizeof(FFI::new("struct {int a}")));
 +    var_dump(FFI::sizeof(FFI::new("struct {int a; int b}")));
  ?>
  ok
  --EXPECT--
Simple merge
index eb7f3b95f672c30a0761fbfc3c1f2660c1da587a,b73c38aefb56abd687bd2acc8874f614dd99deed..981b7c31d2bac3046355a23af3c7b9afd695cf63
@@@ -23,5 -23,7 +23,5 @@@ try 
  --EXPECTF--
  bool(true)
  bool(false)
 -
 -Warning: FFI::isNull() expects parameter 1 to be FFI\CData, null given in %s045.php on line %d
 -NULL
 +TypeError: FFI::isNull() expects parameter 1 to be FFI\CData, null given
- FFI\Exception: FFI\Cdata is not a pointer
+ FFI\Exception: Cannot instantiate FFI\CData of zero size