summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-06-30 16:44:12 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-06-30 16:50:49 +0200
commitabbc1e683c1277a85988e300b82cdea28e519f73 (patch)
tree0088a96116d81a15e40f3e2cf7cb609153a8dbed /ext
parent7c042190988dc51ac60ba6171dce66361394ae22 (diff)
parente2285eb5426161b89217a7929321084f4b75091e (diff)
downloadphp-git-abbc1e683c1277a85988e300b82cdea28e519f73.tar.gz
Merge branch 'PHP-7.2'
* PHP-7.2: Fix #71848: getimagesize with $imageinfo returns false
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/image.c2
-rw-r--r--ext/standard/tests/image/bug71848.jpgbin0 -> 699 bytes
-rw-r--r--ext/standard/tests/image/bug71848.phpt32
3 files changed, 33 insertions, 1 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c
index e34f5c79e8..81676b7a0c 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -453,7 +453,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
buffer = emalloc(length);
- if (php_stream_read(stream, buffer, (zend_long) length) <= 0) {
+ if (php_stream_read(stream, buffer, (zend_long) length) != length) {
efree(buffer);
return 0;
}
diff --git a/ext/standard/tests/image/bug71848.jpg b/ext/standard/tests/image/bug71848.jpg
new file mode 100644
index 0000000000..9588dbe00b
--- /dev/null
+++ b/ext/standard/tests/image/bug71848.jpg
Binary files differ
diff --git a/ext/standard/tests/image/bug71848.phpt b/ext/standard/tests/image/bug71848.phpt
new file mode 100644
index 0000000000..d96ac1c537
--- /dev/null
+++ b/ext/standard/tests/image/bug71848.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #71848 (getimagesize with $imageinfo returns false)
+--FILE--
+<?php
+var_dump(getimagesize(__DIR__ . '/bug71848.jpg', $info));
+var_dump(array_keys($info));
+?>
+===DONE===
+--EXPECT--
+array(7) {
+ [0]=>
+ int(8)
+ [1]=>
+ int(8)
+ [2]=>
+ int(2)
+ [3]=>
+ string(20) "width="8" height="8""
+ ["bits"]=>
+ int(8)
+ ["channels"]=>
+ int(3)
+ ["mime"]=>
+ string(10) "image/jpeg"
+}
+array(2) {
+ [0]=>
+ string(4) "APP0"
+ [1]=>
+ string(4) "APP5"
+}
+===DONE===