Browse Source
Merge branch 'master' into test
Merge branch 'master' into test
* master: (39 commits) Add __debugInfo() to UPGRADING. fix TS build Update NEWS Update NEWS Update NEWS Small tidy ups and raise visibility of GitHub PR process Bug #41631: Observe socket read timeouts in SSL streams wrap int8_t and int16_t with #ifdef to avoid possible clashes - Updated to version 2014.6 (2014f) Removed Countable::count() change info from UPGRADE.INTERNALS too NEWS and UPGRADING for intdiv() Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option" Fixed skip case for intdiv 64-bit test Use callback structure Add EXPECTF Fix handling of multi-result sets with PS...used to clean not only the result set but the whole PS. 5.5.17 now 5.4.33-dev now Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option ... Conflicts: ext/fileinfo/libmagic/softmagic.c main/streams/xp_socket.cpull/700/merge
27 changed files with 1905 additions and 1376 deletions
-
1NEWS
-
35README.SUBMITTING_PATCH
-
4UPGRADING
-
2704ext/date/lib/timezonedb.h
-
2ext/fileinfo/data_file.c
-
29ext/fileinfo/libmagic/softmagic.c
-
56ext/fileinfo/magicdata.patch
-
35ext/fileinfo/tests/cve-2014-3538.phpt
-
2ext/ftp/ftp.c
-
7ext/gd/libgd/gdxpm.c
-
120ext/mysqli/tests/mysqli_stmt_multires.phpt
-
54ext/mysqlnd/mysqlnd_ps.c
-
3ext/mysqlnd/mysqlnd_structs.h
-
46ext/openssl/xp_ssl.c
-
6ext/standard/basic_functions.c
-
8ext/standard/info.c
-
23ext/standard/math.c
-
1ext/standard/php_math.h
-
25ext/standard/tests/math/intdiv.phpt
-
15ext/standard/tests/math/intdiv_64bit.phpt
-
BINext/zlib/tests/bug67724.gz.gz
-
26ext/zlib/tests/bug67724.phpt
-
3ext/zlib/zlib_filter.c
-
27main/network.c
-
9main/php_network.h
-
36main/streams/xp_socket.c
-
4win32/php_stdint.h
2704
ext/date/lib/timezonedb.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,4 +1,58 @@ |
|||
Patches applied to file sources tree before generating magic.mgc |
|||
Patches applied to file 5.17 sources tree before generating magic.mgc |
|||
and before running create_data_file.php to create data_file.c. |
|||
|
|||
|
|||
|
|||
From 0b478f445b6b7540b58af5d1fe583fa9e48fd745 Mon Sep 17 00:00:00 2001 |
|||
From: Christos Zoulas <christos@zoulas.com> |
|||
Date: Wed, 28 May 2014 19:52:36 +0000 |
|||
Subject: [PATCH] further optimize awk by not looking for the BEGIN regex until |
|||
we found the BEGIN (Jan Kaluza) |
|||
|
|||
---
|
|||
magic/Magdir/commands | 5 +++-- |
|||
1 file changed, 3 insertions(+), 2 deletions(-) |
|||
|
|||
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
|||
index bfffdef..26b2869 100644
|
|||
--- a/magic/Magdir/commands
|
|||
+++ b/magic/Magdir/commands
|
|||
@@ -49,7 +49,8 @@
|
|||
!:mime text/x-awk |
|||
0 string/wt #!\ /usr/bin/awk awk script text executable |
|||
!:mime text/x-awk |
|||
-0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
|||
+0 search/16384 BEGIN
|
|||
+>0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
|||
|
|||
# AT&T Bell Labs' Plan 9 shell |
|||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable |
|||
--
|
|||
2.0.3 |
|||
|
|||
From 71a8b6c0d758acb0f73e2e51421a711b5e9d6668 Mon Sep 17 00:00:00 2001 |
|||
From: Christos Zoulas <christos@zoulas.com> |
|||
Date: Fri, 30 May 2014 16:48:44 +0000 |
|||
Subject: [PATCH] Limit regex search for BEGIN to the first 4K of the file. |
|||
|
|||
---
|
|||
magic/Magdir/commands | 5 ++--- |
|||
1 file changed, 2 insertions(+), 3 deletions(-) |
|||
|
|||
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
|||
index 26b2869..bcd0f43 100644
|
|||
--- a/magic/Magdir/commands
|
|||
+++ b/magic/Magdir/commands
|
|||
@@ -49,8 +49,7 @@
|
|||
!:mime text/x-awk |
|||
0 string/wt #!\ /usr/bin/awk awk script text executable |
|||
!:mime text/x-awk |
|||
-0 search/16384 BEGIN
|
|||
->0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
|||
+0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
|||
|
|||
# AT&T Bell Labs' Plan 9 shell |
|||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable |
|||
--
|
|||
2.0.3 |
|||
|
|||
@ -0,0 +1,35 @@ |
|||
--TEST-- |
|||
Bug #66731: file: extensive backtraking |
|||
--SKIPIF-- |
|||
<?php |
|||
if (!class_exists('finfo')) |
|||
die('skip no fileinfo extension'); |
|||
--FILE-- |
|||
<?php |
|||
$fd = __DIR__.'/cve-2014-3538.data'; |
|||
|
|||
file_put_contents($fd, |
|||
'try:' . |
|||
str_repeat("\n", 1000000)); |
|||
|
|||
$fi = finfo_open(FILEINFO_NONE); |
|||
$t = microtime(true); |
|||
var_dump(finfo_file($fi, $fd)); |
|||
$t = microtime(true) - $t; |
|||
finfo_close($fi); |
|||
if ($t < 1) { |
|||
echo "Ok\n"; |
|||
} else { |
|||
printf("Failed, time=%.2f\n", $t); |
|||
} |
|||
|
|||
?> |
|||
Done |
|||
--CLEAN-- |
|||
<?php |
|||
@unlink(__DIR__.'/cve-2014-3538.data'); |
|||
?> |
|||
--EXPECTF-- |
|||
string(%d) "%s" |
|||
Ok |
|||
Done |
|||
@ -0,0 +1,120 @@ |
|||
--TEST-- |
|||
Multiple result set with PS |
|||
--SKIPIF-- |
|||
<?php |
|||
require_once('skipif.inc'); |
|||
require_once("connect.inc"); |
|||
if (!$IS_MYSQLND) { |
|||
die("skip mysqlnd only test"); |
|||
} |
|||
require_once('skipifconnectfailure.inc'); |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
require_once("connect.inc"); |
|||
require('table.inc'); |
|||
|
|||
$stmt = mysqli_stmt_init($link); |
|||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) { |
|||
printf("[001] [%d] %s\n", $link->error, $link->errno); |
|||
} |
|||
|
|||
if (!$link->query("CREATE PROCEDURE p123() BEGIN SELECT id+12, CONCAT_WS('-',label,'ahoi') FROM test ORDER BY id LIMIT 1; SELECT id + 42, CONCAT_WS('---',label, label) FROM test ORDER BY id LIMIT 1; END")) { |
|||
printf("[002] [%d] %s\n", $link->error, $link->errno); |
|||
} |
|||
|
|||
if (!($stmt = $link->prepare("CALL p123"))) { |
|||
printf("[003] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
|
|||
if (!$stmt->execute()) { |
|||
printf("[005] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
|
|||
$c_id = NULL; |
|||
$c_label = NULL; |
|||
if (!$stmt->bind_result($c_id, $c_label)) { |
|||
printf("[004] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
var_dump("pre:",$c_id, $c_label); |
|||
|
|||
if (!$stmt->fetch()) { |
|||
printf("[006] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
|
|||
var_dump("post:",$c_id, $c_label); |
|||
|
|||
if ($stmt->fetch()) { |
|||
printf("[007] Shouldn't have fetched anything\n"); |
|||
var_dump($c_id, $c_label); |
|||
} |
|||
|
|||
if ($stmt->fetch()) { |
|||
printf("[008] No more rows expected\n"); |
|||
} |
|||
|
|||
if (!$stmt->more_results()) { |
|||
printf("[009] Expected more results\n"); |
|||
} else { |
|||
var_dump("[009] next_result:", $stmt->next_result()); |
|||
} |
|||
|
|||
if (!$stmt->bind_result($c_id, $c_label)) { |
|||
printf("[010] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
var_dump("pre:",$c_id, $c_label); |
|||
|
|||
if (!$stmt->fetch()) { |
|||
printf("[011] [%d] %s\n", $stmt->error, $stmt->errno); |
|||
} |
|||
|
|||
var_dump("post:",$c_id, $c_label); |
|||
|
|||
if ($stmt->fetch()) { |
|||
printf("[012] No more rows expected\n"); |
|||
} |
|||
|
|||
if (!$stmt->more_results()) { |
|||
printf("[013] Expected more results\n"); |
|||
} else { |
|||
var_dump("[013] next_result:", $stmt->next_result()); |
|||
} |
|||
|
|||
if ($stmt->more_results()) { |
|||
printf("[014] No more results expected\n"); |
|||
} else { |
|||
printf("[014] No result, as expected\n"); |
|||
} |
|||
|
|||
$stmt->close(); |
|||
$link->close(); |
|||
|
|||
|
|||
echo "done"; |
|||
?> |
|||
--CLEAN-- |
|||
<?php |
|||
require_once("connect.inc"); |
|||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) { |
|||
printf("[001] [%d] %s\n", $link->error, $link->errno); |
|||
} |
|||
?> |
|||
--EXPECTF-- |
|||
string(4) "pre:" |
|||
NULL |
|||
NULL |
|||
string(5) "post:" |
|||
int(13) |
|||
string(6) "a-ahoi" |
|||
string(18) "[009] next_result:" |
|||
bool(true) |
|||
string(4) "pre:" |
|||
int(13) |
|||
string(6) "a-ahoi" |
|||
string(5) "post:" |
|||
int(43) |
|||
string(5) "a---a" |
|||
string(18) "[013] next_result:" |
|||
bool(true) |
|||
[014] No result, as expected |
|||
done |
|||
@ -0,0 +1,25 @@ |
|||
--TEST-- |
|||
intdiv functionality |
|||
--FILE-- |
|||
<?php |
|||
var_dump(intdiv(3, 2)); |
|||
var_dump(intdiv(-3, 2)); |
|||
var_dump(intdiv(3, -2)); |
|||
var_dump(intdiv(-3, -2)); |
|||
var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX)); |
|||
var_dump(intdiv(-PHP_INT_MAX - 1, -PHP_INT_MAX - 1)); |
|||
var_dump(intdiv(-PHP_INT_MAX - 1, -1)); |
|||
var_dump(intdiv(1, 0)); |
|||
|
|||
?> |
|||
--EXPECTF-- |
|||
int(1) |
|||
int(-1) |
|||
int(-1) |
|||
int(1) |
|||
int(1) |
|||
int(1) |
|||
int(0) |
|||
|
|||
Warning: intdiv(): Division by zero in %s on line 9 |
|||
bool(false) |
|||
@ -0,0 +1,15 @@ |
|||
--TEST-- |
|||
intdiv functionality |
|||
--SKIPIF-- |
|||
<?php |
|||
if (PHP_INT_SIZE !== 8) { |
|||
die("skip this test is for 64-bit platforms only"); |
|||
} |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
// (int)(PHP_INT_MAX / 3) gives a different result |
|||
var_dump(intdiv(PHP_INT_MAX, 3)); |
|||
?> |
|||
--EXPECTF-- |
|||
int(3074457345618258602) |
|||
@ -0,0 +1,26 @@ |
|||
--TEST-- |
|||
Bug #67724 (chained zlib filters silently fail with large amounts of data) |
|||
--SKIPIF-- |
|||
<?php |
|||
extension_loaded("zlib") or die("skip need ext/zlib"); |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
echo "Test\n"; |
|||
|
|||
$f = fopen(__DIR__."/bug67724.gz.gz", "rb") |
|||
or die(current(error_get_last())); |
|||
stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]); |
|||
stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]); |
|||
for ($i = 0; !feof($f); $i += strlen(fread($f, 0x1000))) |
|||
; |
|||
fclose($f); |
|||
|
|||
var_dump($i); |
|||
|
|||
?> |
|||
DONE |
|||
--EXPECT-- |
|||
Test |
|||
int(25600000) |
|||
DONE |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue