]> granicus.if.org Git - php/commitdiff
Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
authorAnatol Belski <ab@php.net>
Sun, 27 Mar 2016 22:45:19 +0000 (00:45 +0200)
committerAnatol Belski <ab@php.net>
Tue, 29 Mar 2016 11:11:25 +0000 (13:11 +0200)
The actual fix is applying the upstream patch from
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36

ext/fileinfo/tests/bug68996.phpt

index 9fa219030797041984b4e2014fe7464f90858438..da208d35bcc0194b7af321f8283b951ef5d8a8ae 100644 (file)
@@ -1,14 +1,11 @@
 --TEST--
 Bug #68996 (Invalid free of CG(interned_empty_string))
 --SKIPIF--
-<?php
-if (getenv("USE_ZEND_ALLOC") !== "0") {
-    print "skip Need Zend MM disabled";
-}
-?>
 <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
 --INI--
 html_errors=1
+--ENV--
+USE_ZEND_ALLOC=0
 --FILE--
 <?php
 finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63");
@@ -19,4 +16,4 @@ finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63");
 <br />
 <b>Warning</b>:  : failed to open stream: No such file or directory in <b>%sbug68996.php</b> on line <b>%d</b><br />
 <br />
-<b>Warning</b>:  finfo_open():  in <b>%sbug68996.php</b> on line <b>%d</b><br />
+<b>Warning</b>:  finfo_open(): Failed to load magic database at '%s�c'. in <b>%sbug68996.php</b> on line <b>%d</b><br />