mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-25 01:45:41 +00:00
Compare commits
100
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9e5f38e5b | ||
|
|
13fbd03e9b | ||
|
|
a6d7dd302c | ||
|
|
d2ac264ffe | ||
|
|
8fc52d77d6 | ||
|
|
07fb924c22 | ||
|
|
68722deccf | ||
|
|
f8d2726267 | ||
|
|
c6dc3fc7f4 | ||
|
|
c056c5801c | ||
|
|
a54f5aa2ae | ||
|
|
0881b98d82 | ||
|
|
8b7149636a | ||
|
|
5845f309b7 | ||
|
|
1f077cc4f4 | ||
|
|
76a290d0be | ||
|
|
c630779648 | ||
|
|
565de1ae64 | ||
|
|
4cab20bbb4 | ||
|
|
e807e07bfa | ||
|
|
4e002b4412 | ||
|
|
f3cec08e65 | ||
|
|
0bc3a74334 | ||
|
|
d9c266f4c9 | ||
|
|
2e2cbcc926 | ||
|
|
827d2c1415 | ||
|
|
f736934af0 | ||
|
|
7ecab5d23f | ||
|
|
c9ac441fe8 | ||
|
|
68e368ed34 | ||
|
|
17d5ebe76e | ||
|
|
a7de68f98a | ||
|
|
c3d983f3af | ||
|
|
4fe938b0a9 | ||
|
|
e85653051a | ||
|
|
fc94fb3e5b | ||
|
|
c507c533bd | ||
|
|
96629091a6 | ||
|
|
6895ae4553 | ||
|
|
8c6e8e7870 | ||
|
|
90aee01c85 | ||
|
|
ad4d022bdf | ||
|
|
75286ece1a | ||
|
|
59a78d48f0 | ||
|
|
3be4e5d71a | ||
|
|
f228bc5230 | ||
|
|
716fe10d97 | ||
|
|
6da4feac35 | ||
|
|
e41a2009d6 | ||
|
|
4bda39b81d | ||
|
|
2cc4e69cc6 | ||
|
|
4c5efc7456 | ||
|
|
58e5e006e5 | ||
|
|
e09a0b74d9 | ||
|
|
8fc4c9444f | ||
|
|
7c5de1e99e | ||
|
|
dcd230de11 | ||
|
|
c09fad97d6 | ||
|
|
f7952b90ca | ||
|
|
c02c4aca00 | ||
|
|
1b12982d39 | ||
|
|
43c24da166 | ||
|
|
587ddf6ddc | ||
|
|
c08f9c2c78 | ||
|
|
f473ea5464 | ||
|
|
2f83797a0c | ||
|
|
adbb301a70 | ||
|
|
2ddb560c2e | ||
|
|
c117548ea9 | ||
|
|
e1cb22a23e | ||
|
|
9c0813fd48 | ||
|
|
634aa0a2db | ||
|
|
ba1d9cc4b7 | ||
|
|
e2bbf0a2df | ||
|
|
c591f022f8 | ||
|
|
be9b2a95ad | ||
|
|
4605d536d2 | ||
|
|
33594b78ec | ||
|
|
473ec539a1 | ||
|
|
329513c3a7 | ||
|
|
8026001943 | ||
|
|
ac3ca0280a | ||
|
|
33e2aa452d | ||
|
|
741382d968 | ||
|
|
ba1c78c410 | ||
|
|
24992a1422 | ||
|
|
cf3e976c3b | ||
|
|
c4f8dd9071 | ||
|
|
7289981c61 | ||
|
|
7af9ba23a7 | ||
|
|
e49a0e17b7 | ||
|
|
fff921d7a3 | ||
|
|
9708378d13 | ||
|
|
56fdae9018 | ||
|
|
c27f012b7a | ||
|
|
ac28329354 | ||
|
|
428d0983cd | ||
|
|
ce6db558f9 | ||
|
|
95fa727992 | ||
|
|
9c7496e0dd |
No files matched your search
@@ -1,5 +1,56 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
11 Jun 2015, PHP 5.6.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66048 (temp. directory is cached during multiple requests).
|
||||
(Julien)
|
||||
. Fixed bug #69566 (Conditional jump or move depends on uninitialised value
|
||||
in extension trait). (jbboehr at gmail dot com)
|
||||
. Fixed bug #69599 (Strange generator+exception+variadic crash). (Nikita)
|
||||
. Fixed bug #69628 (complex GLOB_BRACE fails on Windows).
|
||||
(Christoph M. Becker)
|
||||
. Fixed POST data processing slowdown due to small input buffer size
|
||||
on Windows. (Jorge Oliveira, Anatol)
|
||||
. Fixed bug #69646 (OS command injection vulnerability in escapeshellarg).
|
||||
(Anatol Belski)
|
||||
. Fixed bug #69719 (Incorrect handling of paths with NULs). (Stas)
|
||||
|
||||
- FTP
|
||||
. Improved fix for bug #69545 (Integer overflow in ftp_genlist()
|
||||
resulting in heap overflow). (Max Spelsberg)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #69479 (GD fails to build with newer libvpx). (Remi)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #48147 (iconv with //IGNORE cuts the string). (Stas)
|
||||
|
||||
- Litespeed SAPI:
|
||||
. Fixed bug #68812 (Unchecked return value). (George Wang)
|
||||
|
||||
- Mail:
|
||||
. Fixed bug #68776 (mail() does not have mail header injection prevention for
|
||||
additional headers). (Yasuo)
|
||||
|
||||
- MCrypt:
|
||||
. Added file descriptor caching to mcrypt_create_iv() (Leigh)
|
||||
|
||||
- Opcache
|
||||
. Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF).
|
||||
(Laruence, Dmitry)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69680 (phar symlink in binary directory broken).
|
||||
(Matteo Bernardini, Remi)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #69667 (segfault in php_pgsql_meta_data). (Remi)
|
||||
|
||||
- Sqlite3:
|
||||
. Upgrade bundled sqlite to 3.8.10.2. (CVE-2015-3414, CVE-2015-3415,
|
||||
CVE-2015-3416) (Kaplan)
|
||||
|
||||
14 May 2015, PHP 5.6.9
|
||||
|
||||
- Core:
|
||||
@@ -15,15 +66,17 @@ PHP NEWS
|
||||
(Nikita)
|
||||
. Fixed bug #69472 (php_sys_readlink ignores misc errors from
|
||||
GetFinalPathNameByHandleA). (Jan Starke)
|
||||
. Fixed bug #69364 (PHP Multipart/form-data remote dos Vulnerability). (Stas)
|
||||
. Fixed bug #69364 (PHP Multipart/form-data remote dos Vulnerability).
|
||||
(CVE-2015-4024) (Stas)
|
||||
. Fixed bug #69403 (str_repeat() sign mismatch based memory corruption).
|
||||
(Stas)
|
||||
. Fixed bug #69418 (CVE-2006-7243 fix regressions in 5.4+). (Stas)
|
||||
. Fixed bug #69418 (CVE-2006-7243 fix regressions in 5.4+). (CVE-2015-4025)
|
||||
(Stas)
|
||||
. Fixed bug #69522 (heap buffer overflow in unpack()). (Stas)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #69545 (Integer overflow in ftp_genlist() resulting in heap
|
||||
overflow). (Stas)
|
||||
overflow). (CVE-2015-4022) (Stas)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #69354 (Incorrect use of SQLColAttributes with ODBC 3.0).
|
||||
@@ -38,14 +91,15 @@ PHP NEWS
|
||||
(Daniel Lowrey)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #68598 (pcntl_exec() should not allow null char). (Stas)
|
||||
. Fixed bug #68598 (pcntl_exec() should not allow null char). (CVE-2015-4026)
|
||||
(Stas)
|
||||
|
||||
- PCRE
|
||||
. Upgraded pcrelib to 8.37.
|
||||
. Upgraded pcrelib to 8.37. (CVE-2015-2325, CVE-2015-2326)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #69453 (Memory Corruption in phar_parse_tarfile when entry
|
||||
filename starts with null). (Stas)
|
||||
filename starts with null). (CVE-2015-4021) (Stas)
|
||||
|
||||
16 Apr 2015, PHP 5.6.8
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #69599: Strange generator+exception+variadic crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function crash() {
|
||||
sin(...[0]);
|
||||
throw new \Exception();
|
||||
yield;
|
||||
}
|
||||
|
||||
iterator_to_array(crash());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: crash()
|
||||
#1 %s(%d): iterator_to_array(Object(Generator))
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
+1
-1
@@ -4101,7 +4101,7 @@ static int zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce TSRML
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
||||
}
|
||||
if (fn->op_array.static_variables) {
|
||||
if (fn->type == ZEND_USER_FUNCTION && fn->op_array.static_variables) {
|
||||
ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -1887,7 +1887,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -2075,7 +2075,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -5425,7 +5425,6 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_function *op_array;
|
||||
int closure_is_static, closure_is_being_defined_inside_static_context;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -5434,9 +5433,9 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
||||
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
|
||||
}
|
||||
|
||||
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
(EX(prev_execute_data) &&
|
||||
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);
|
||||
|
||||
@@ -459,7 +459,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -647,7 +647,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
|
||||
EX(call)--;
|
||||
|
||||
zend_vm_stack_clear_multiple(1 TSRMLS_CC);
|
||||
zend_vm_stack_clear_multiple(0 TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
@@ -6801,7 +6801,6 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_function *op_array;
|
||||
int closure_is_static, closure_is_being_defined_inside_static_context;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -6810,9 +6809,9 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
|
||||
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
|
||||
}
|
||||
|
||||
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
(EX(prev_execute_data) &&
|
||||
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=6
|
||||
PHP_RELEASE_VERSION=9
|
||||
PHP_RELEASE_VERSION=10
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -61,7 +61,7 @@ array\(11\) {
|
||||
\["mday"\]=>
|
||||
int\((9|14|23)\)
|
||||
\["wday"\]=>
|
||||
int\(0\)
|
||||
int\((0|6)\)
|
||||
\["mon"\]=>
|
||||
int\((10|12)\)
|
||||
\["year"\]=>
|
||||
@@ -69,7 +69,7 @@ array\(11\) {
|
||||
\["yday"\]=>
|
||||
int\((282|347|295)\)
|
||||
\["weekday"\]=>
|
||||
string\(6\) "Sunday"
|
||||
string\((6|8)\) "(Sunday|Saturday)"
|
||||
\["month"\]=>
|
||||
string\((7|8)\) "(October|December)"
|
||||
\[0\]=>
|
||||
|
||||
@@ -87,7 +87,7 @@ array\(9\) {
|
||||
\[5\]=>
|
||||
int\((104|1|-3843)\)
|
||||
\[6\]=>
|
||||
int\(6\)
|
||||
int\((5|6)\)
|
||||
\[7\]=>
|
||||
int\((281|346|294)\)
|
||||
\[8\]=>
|
||||
@@ -107,7 +107,7 @@ array\(9\) {
|
||||
\["tm_year"\]=>
|
||||
int\((104|1|-3843)\)
|
||||
\["tm_wday"\]=>
|
||||
int\(6\)
|
||||
int\((5|6)\)
|
||||
\["tm_yday"\]=>
|
||||
int\((281|346|294)\)
|
||||
\["tm_isdst"\]=>
|
||||
|
||||
+17
-5
@@ -1700,7 +1700,7 @@ PHP_FUNCTION(dom_document_save)
|
||||
char *file;
|
||||
long options = 0;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1930,7 +1930,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1943,6 +1943,10 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
|
||||
switch (type) {
|
||||
case DOM_LOAD_FILE:
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
if (!valid_file) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
|
||||
@@ -2026,7 +2030,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2039,6 +2043,10 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
|
||||
switch (type) {
|
||||
case DOM_LOAD_FILE:
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
if (!valid_file) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
|
||||
@@ -2119,7 +2127,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
|
||||
id = getThis();
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2129,6 +2137,10 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
}
|
||||
|
||||
if (mode == DOM_LOAD_FILE) {
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid file source");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ctxt = htmlCreateFileParserCtxt(source, NULL);
|
||||
} else {
|
||||
source_len = xmlStrlen(source);
|
||||
@@ -2217,7 +2229,7 @@ PHP_FUNCTION(dom_document_save_html_file)
|
||||
char *file;
|
||||
const char *encoding;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ $result = $doc->loadHTMLFile("");
|
||||
assert('$result === false');
|
||||
$doc = new DOMDocument();
|
||||
$result = $doc->loadHTMLFile("text.html\0something");
|
||||
assert('$result === null');
|
||||
assert('$result === false');
|
||||
?>
|
||||
--EXPECTF--
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
|
||||
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile() expects parameter 1 to be a valid path, string given %s
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Invalid file source %s
|
||||
@@ -1663,8 +1663,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
for (ptr = data->buf; rcvd; rcvd--, ptr++) {
|
||||
if (*ptr == '\n' && lastch == '\r') {
|
||||
lines++;
|
||||
} else {
|
||||
size++;
|
||||
}
|
||||
lastch = *ptr;
|
||||
}
|
||||
|
||||
+7
-7
@@ -1750,7 +1750,7 @@ PHP_FUNCTION(imagefilledarc)
|
||||
long cx, cy, w, h, ST, E, col, style;
|
||||
gdImagePtr im;
|
||||
int e, st;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -1991,7 +1991,7 @@ PHP_FUNCTION(imagegrabwindow)
|
||||
if ( handle == 0 ) {
|
||||
goto clean;
|
||||
}
|
||||
pPrintWindow = (tPrintWindow) GetProcAddress(handle, "PrintWindow");
|
||||
pPrintWindow = (tPrintWindow) GetProcAddress(handle, "PrintWindow");
|
||||
|
||||
if ( pPrintWindow ) {
|
||||
pPrintWindow(window, memDC, (UINT) client_area);
|
||||
@@ -3860,7 +3860,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
if (zend_hash_get_current_data_ex(HASH_OF(EXT), (void **) &item, &pos) == FAILURE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (strcmp("linespacing", key) == 0) {
|
||||
convert_to_double_ex(item);
|
||||
strex.flags |= gdFTEX_LINESPACE;
|
||||
@@ -3939,7 +3939,7 @@ PHP_FUNCTION(imagepsloadfont)
|
||||
struct stat st;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4279,11 +4279,11 @@ PHP_FUNCTION(imagepsbbox)
|
||||
if (argc != 3 && argc != 6) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (argc == 6) {
|
||||
space = sp;
|
||||
add_width = wd;
|
||||
@@ -4459,7 +4459,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
int x, y;
|
||||
float x_ratio, y_ratio;
|
||||
long ignore_warning;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -706,14 +706,14 @@ static WebPResult VPXEncode(const uint8* Y,
|
||||
codec_ctl(&enc, VP8E_SET_STATIC_THRESHOLD, 0);
|
||||
codec_ctl(&enc, VP8E_SET_TOKEN_PARTITIONS, 2);
|
||||
|
||||
vpx_img_wrap(&img, IMG_FMT_I420,
|
||||
vpx_img_wrap(&img, VPX_IMG_FMT_I420,
|
||||
y_width, y_height, 16, (uint8*)(Y));
|
||||
img.planes[PLANE_Y] = (uint8*)(Y);
|
||||
img.planes[PLANE_U] = (uint8*)(U);
|
||||
img.planes[PLANE_V] = (uint8*)(V);
|
||||
img.stride[PLANE_Y] = y_stride;
|
||||
img.stride[PLANE_U] = uv_stride;
|
||||
img.stride[PLANE_V] = uv_stride;
|
||||
img.planes[VPX_PLANE_Y] = (uint8*)(Y);
|
||||
img.planes[VPX_PLANE_U] = (uint8*)(U);
|
||||
img.planes[VPX_PLANE_V] = (uint8*)(V);
|
||||
img.stride[VPX_PLANE_Y] = y_stride;
|
||||
img.stride[VPX_PLANE_U] = uv_stride;
|
||||
img.stride[VPX_PLANE_V] = uv_stride;
|
||||
|
||||
res = vpx_codec_encode(&enc, &img, 0, 1, 0, VPX_DL_BEST_QUALITY);
|
||||
|
||||
|
||||
+35
-4
@@ -35,7 +35,7 @@ if test "$PHP_ICONV" != "no"; then
|
||||
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
|
||||
else
|
||||
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if iconv is glibc's])
|
||||
AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
|
||||
@@ -53,8 +53,8 @@ if test "$PHP_ICONV" != "no"; then
|
||||
AC_TRY_RUN([
|
||||
#include <$PHP_ICONV_H_PATH>
|
||||
int main() {
|
||||
printf("%d", _libiconv_version);
|
||||
return 0;
|
||||
printf("%d", _libiconv_version);
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -138,7 +138,7 @@ int main() {
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
if (errno == EINVAL) {
|
||||
return 0;
|
||||
} else {
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,37 @@ int main() {
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if iconv supports //IGNORE])
|
||||
AC_TRY_RUN([
|
||||
#include <$PHP_ICONV_H_PATH>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
iconv_t cd = iconv_open( "UTF-8//IGNORE", "UTF-8" );
|
||||
char *in_p = "\xC3\xC3\xC3\xB8";
|
||||
size_t in_left = 4, out_left = 4096;
|
||||
char *out = malloc(out_left);
|
||||
char *out_p = out;
|
||||
size_t result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left);
|
||||
if(result == (size_t)-1) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
|
||||
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
PHP_DEFINE([ICONV_BROKEN_IGNORE],1,[ext/iconv])
|
||||
AC_DEFINE([ICONV_BROKEN_IGNORE],1,[Whether iconv supports IGNORE])
|
||||
],[
|
||||
AC_MSG_RESULT(no, cross-compiling)
|
||||
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports IGNORE])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
|
||||
AC_TRY_COMPILE([
|
||||
#define FOO <$PHP_ICONV_H_PATH>
|
||||
|
||||
@@ -529,6 +529,24 @@ static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ */
|
||||
#if ICONV_BROKEN_IGNORE
|
||||
static int _php_check_ignore(const char *charset)
|
||||
{
|
||||
size_t clen = strlen(charset);
|
||||
if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) {
|
||||
return 1;
|
||||
}
|
||||
if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#define _php_check_ignore(x) (0)
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_iconv_string()
|
||||
*/
|
||||
PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
@@ -610,6 +628,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
char *out_p, *out_buf, *tmp_buf;
|
||||
size_t bsz, result = 0;
|
||||
php_iconv_err_t retval = PHP_ICONV_ERR_SUCCESS;
|
||||
int ignore_ilseq = _php_check_ignore(out_charset);
|
||||
|
||||
*out = NULL;
|
||||
*out_len = 0;
|
||||
@@ -634,6 +653,17 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left);
|
||||
out_size = bsz - out_left;
|
||||
if (result == (size_t)(-1)) {
|
||||
if (ignore_ilseq && errno == EILSEQ) {
|
||||
if (in_left <= 1) {
|
||||
result = 0;
|
||||
} else {
|
||||
errno = 0;
|
||||
in_p++;
|
||||
in_left--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (errno == E2BIG && in_left > 0) {
|
||||
/* converted string is longer than out buffer */
|
||||
bsz += in_len;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #48147 (iconv with //IGNORE cuts the string)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$text = "aa\xC3\xC3\xC3\xB8aa";
|
||||
var_dump(iconv("UTF-8", "UTF-8", $text));
|
||||
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", $text)));
|
||||
// only invalid
|
||||
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "\xC3")));
|
||||
// start invalid
|
||||
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "\xC3\xC3\xC3\xB8aa")));
|
||||
// finish invalid
|
||||
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "aa\xC3\xC3\xC3")));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: iconv(): Detected an illegal character in input string in %s on line %d
|
||||
bool(false)
|
||||
string(10) "aa%C3%B8aa"
|
||||
|
||||
Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d
|
||||
string(0) ""
|
||||
string(8) "%C3%B8aa"
|
||||
|
||||
Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d
|
||||
string(0) ""
|
||||
+23
-9
@@ -380,7 +380,7 @@ static void php_mcrypt_module_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
|
||||
{
|
||||
le_mcrypt = zend_register_list_destructors_ex(php_mcrypt_module_dtor, NULL, "mcrypt", module_number);
|
||||
@@ -438,6 +438,9 @@ static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
|
||||
php_stream_filter_register_factory("mcrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
|
||||
php_stream_filter_register_factory("mdecrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
|
||||
|
||||
MCG(fd[RANDOM]) = -1;
|
||||
MCG(fd[URANDOM]) = -1;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -447,6 +450,14 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
|
||||
php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
|
||||
php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
|
||||
|
||||
if (MCG(fd[RANDOM]) > 0) {
|
||||
close(MCG(fd[RANDOM]));
|
||||
}
|
||||
|
||||
if (MCG(fd[URANDOM]) > 0) {
|
||||
close(MCG(fd[URANDOM]));
|
||||
}
|
||||
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -1423,24 +1434,27 @@ PHP_FUNCTION(mcrypt_create_iv)
|
||||
}
|
||||
n = size;
|
||||
#else
|
||||
int fd;
|
||||
int *fd = &MCG(fd[source]);
|
||||
size_t read_bytes = 0;
|
||||
|
||||
fd = open(source == RANDOM ? "/dev/random" : "/dev/urandom", O_RDONLY);
|
||||
if (fd < 0) {
|
||||
efree(iv);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open source device");
|
||||
RETURN_FALSE;
|
||||
if (*fd < 0) {
|
||||
*fd = open(source == RANDOM ? "/dev/random" : "/dev/urandom", O_RDONLY);
|
||||
if (*fd < 0) {
|
||||
efree(iv);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open source device");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
while (read_bytes < size) {
|
||||
n = read(fd, iv + read_bytes, size - read_bytes);
|
||||
n = read(*fd, iv + read_bytes, size - read_bytes);
|
||||
if (n < 0) {
|
||||
break;
|
||||
}
|
||||
read_bytes += n;
|
||||
}
|
||||
n = read_bytes;
|
||||
close(fd);
|
||||
|
||||
if (n < size) {
|
||||
efree(iv);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
|
||||
|
||||
@@ -77,6 +77,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
|
||||
int le_h;
|
||||
char *modes_dir;
|
||||
char *algorithms_dir;
|
||||
int fd[2]; // RANDOM = 0, URANDOM = 1
|
||||
ZEND_END_MODULE_GLOBALS(mcrypt)
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -1759,13 +1759,15 @@ next_target_ex:
|
||||
}
|
||||
} else if (block->op2_to == block->ext_to) {
|
||||
/* both goto the same one - it's JMP */
|
||||
/* JMPZNZ(?,L,L) -> JMP(L) */
|
||||
last_op->opcode = ZEND_JMP;
|
||||
SET_UNUSED(last_op->op1);
|
||||
SET_UNUSED(last_op->op2);
|
||||
block->op1_to = block->op2_to;
|
||||
block->op2_to = NULL;
|
||||
block->ext_to = NULL;
|
||||
if (!(last_op->op1_type & (IS_VAR|IS_TMP_VAR))) {
|
||||
/* JMPZNZ(?,L,L) -> JMP(L) */
|
||||
last_op->opcode = ZEND_JMP;
|
||||
SET_UNUSED(last_op->op1);
|
||||
SET_UNUSED(last_op->op2);
|
||||
block->op1_to = block->op2_to;
|
||||
block->op2_to = NULL;
|
||||
block->ext_to = NULL;
|
||||
}
|
||||
} else if (block->op2_to == next) {
|
||||
/* jumping to next on Z - can follow to it and jump only on NZ */
|
||||
/* JMPZNZ(X,L1,L2) L1: -> JMPNZ(X,L2) */
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#define ACCELERATOR_PRODUCT_NAME "Zend OPcache"
|
||||
#define PHP_ZENDOPCACHE_VERSION "7.0.4-dev"
|
||||
#define PHP_ZENDOPCACHE_VERSION "7.0.6-dev"
|
||||
#define ACCELERATOR_VERSION PHP_ZENDOPCACHE_VERSION
|
||||
/* 2 - added Profiler support, on 20010712 */
|
||||
/* 3 - added support for Optimizer's encoded-only-files mode */
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(true);
|
||||
if($a[0] && false) {
|
||||
echo 'test';
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -35,11 +35,6 @@ $clientCode = <<<'CODE'
|
||||
|
||||
phpt_wait();
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_SSLv3_CLIENT);
|
||||
stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx);
|
||||
$meta = stream_context_get_options($clientCtx)['ssl']['session_meta'];
|
||||
var_dump($meta['protocol']);
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
|
||||
stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx);
|
||||
$meta = stream_context_get_options($clientCtx)['ssl']['session_meta'];
|
||||
@@ -59,7 +54,6 @@ CODE;
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
string(5) "SSLv3"
|
||||
string(5) "TLSv1"
|
||||
string(7) "TLSv1.1"
|
||||
string(7) "TLSv1.2"
|
||||
@@ -32,9 +32,6 @@ $clientCode = <<<'CODE'
|
||||
|
||||
phpt_wait();
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_SSLv3_CLIENT);
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
|
||||
@@ -47,4 +44,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
@@ -13,7 +13,7 @@ $serverCode = <<<'CODE'
|
||||
$serverCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/bug54992.pem',
|
||||
|
||||
// Only accept SSLv3 and TLSv1.2 connections
|
||||
// Only accept TLSv1.2 connections
|
||||
'crypto_method' => STREAM_CRYPTO_METHOD_SSLv3_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER,
|
||||
]]);
|
||||
|
||||
@@ -40,9 +40,6 @@ $clientCode = <<<'CODE'
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_SSLv3_CLIENT);
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
|
||||
stream_context_set_option($clientCtx, 'ssl', 'crypto_method', STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT);
|
||||
var_dump(@stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
|
||||
@@ -54,7 +51,6 @@ include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
@@ -4,6 +4,7 @@ Specific crypto method for ssl:// transports.
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (!function_exists("proc_open")) die("skip no proc_open");
|
||||
if (OPENSSL_VERSION_NUMBER < 0x10001001) die("skip OpenSSLv1.0.1 required");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
@@ -37,7 +38,7 @@ $clientCode = <<<'CODE'
|
||||
$serverUri = "https://127.0.0.1:64321/";
|
||||
$clientFlags = STREAM_CLIENT_CONNECT;
|
||||
$clientCtx = stream_context_create(['ssl' => [
|
||||
'crypto_method' => STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
|
||||
'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false
|
||||
]]);
|
||||
|
||||
@@ -314,7 +314,7 @@ them both to 0; an emulation function will be used. */
|
||||
#define PACKAGE_NAME "PCRE"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "PCRE 8.36"
|
||||
#define PACKAGE_STRING "PCRE 8.37"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "pcre"
|
||||
@@ -323,7 +323,7 @@ them both to 0; an emulation function will be used. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "8.36"
|
||||
#define PACKAGE_VERSION "8.37"
|
||||
|
||||
/* to make a symbol visible */
|
||||
/* #undef PCRECPP_EXP_DECL */
|
||||
@@ -439,7 +439,7 @@ them both to 0; an emulation function will be used. */
|
||||
|
||||
/* Version number of package */
|
||||
#ifndef VERSION
|
||||
#define VERSION "8.36"
|
||||
#define VERSION "8.37"
|
||||
#endif
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
|
||||
+7
-2
@@ -5479,7 +5479,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
|
||||
|
||||
src = estrdup(table_name);
|
||||
tmp_name = php_strtok_r(src, ".", &tmp_name2);
|
||||
|
||||
if (!tmp_name) {
|
||||
efree(src);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified");
|
||||
return FAILURE;
|
||||
}
|
||||
if (!tmp_name2 || !*tmp_name2) {
|
||||
/* Default schema */
|
||||
tmp_name2 = tmp_name;
|
||||
@@ -6496,7 +6500,8 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt T
|
||||
|
||||
static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const char *table)
|
||||
{
|
||||
char *table_copy, *escaped, *token, *tmp;
|
||||
char *table_copy, *escaped, *tmp;
|
||||
const char *token;
|
||||
size_t len;
|
||||
|
||||
/* schame.table should be "schame"."table" */
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
PostgreSQL pg_insert() - test for CVE-2015-1532
|
||||
--SKIPIF--
|
||||
<?php include("skipif.inc"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include('config.inc');
|
||||
|
||||
$conn = pg_connect($conn_str);
|
||||
|
||||
foreach (array('', '.', '..') as $table) {
|
||||
var_dump(pg_insert($conn, $table, array('id' => 1, 'id2' => 1)));
|
||||
}
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
|
||||
Warning: pg_insert(): The table name must be specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: pg_insert(): The table name must be specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: pg_insert(): The table name must be specified in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -39,7 +39,7 @@ install-pharcmd: pharcmd
|
||||
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
|
||||
$(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir)
|
||||
-@rm -f $(INSTALL_ROOT)$(bindir)/phar
|
||||
$(LN_S) -f $(INSTALL_ROOT)$(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar
|
||||
$(LN_S) -f phar.phar $(INSTALL_ROOT)$(bindir)/phar
|
||||
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
|
||||
@$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1
|
||||
@$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1
|
||||
|
||||
@@ -14,7 +14,7 @@ $r = new Phar($fname, 0);
|
||||
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
exception 'UnexpectedValueException' with message 'phar error: corrupted central directory entry, no magic signature in zip-based phar "%s%ebug69441.phar"' in %s%ebug69441.php:%d
|
||||
exception 'UnexpectedValueException' with message 'phar error: corrupted central directory entry, no magic signature in zip-based phar "%sbug69441.phar"' in %sbug69441.php:%d
|
||||
Stack trace:
|
||||
#0 %s%ebug69441.php(%d): Phar->__construct('%s', 0)
|
||||
#1 {main}
|
||||
|
||||
+4414
-1919
File diff suppressed because it is too large.
Load diff
+407
-291
File diff suppressed because it is too large.
Load diff
@@ -4120,7 +4120,7 @@ PHP_FUNCTION(putenv)
|
||||
Obviously the CRT version will be useful more often. But
|
||||
generally, doing both brings us on the safe track at least
|
||||
in NTS build. */
|
||||
&& _putenv(pe.putenv_string) == 0
|
||||
&& _putenv_s(pe.key, value ? value : "") == 0
|
||||
# endif
|
||||
) { /* success */
|
||||
# endif
|
||||
|
||||
@@ -380,6 +380,14 @@ PHPAPI char *php_escape_shell_arg(char *str)
|
||||
}
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
if (y > 0 && '\\' == cmd[y - 1]) {
|
||||
int k = 0, n = y - 1;
|
||||
for (; n >= 0 && '\\' == cmd[n]; n--, k++);
|
||||
if (k % 2) {
|
||||
cmd[y++] = '\\';
|
||||
}
|
||||
}
|
||||
|
||||
cmd[y++] = '"';
|
||||
#else
|
||||
cmd[y++] = '\'';
|
||||
|
||||
@@ -223,6 +223,44 @@ void php_mail_log_to_file(char *filename, char *message, size_t message_size TSR
|
||||
}
|
||||
|
||||
|
||||
static int php_mail_detect_multiple_crlf(char *hdr) {
|
||||
/* This function detects multiple/malformed multiple newlines. */
|
||||
size_t len;
|
||||
|
||||
if (!hdr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Should not have any newlines at the beginning. */
|
||||
/* RFC 2822 2.2. Header Fields */
|
||||
if (*hdr < 33 || *hdr > 126 || *hdr == ':') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
while(*hdr) {
|
||||
if (*hdr == '\r') {
|
||||
if (*(hdr+1) == '\0' || *(hdr+1) == '\r' || (*(hdr+1) == '\n' && (*(hdr+2) == '\0' || *(hdr+2) == '\n' || *(hdr+2) == '\r'))) {
|
||||
/* Malformed or multiple newlines. */
|
||||
return 1;
|
||||
} else {
|
||||
hdr += 2;
|
||||
}
|
||||
} else if (*hdr == '\n') {
|
||||
if (*(hdr+1) == '\0' || *(hdr+1) == '\r' || *(hdr+1) == '\n') {
|
||||
/* Malformed or multiple newlines. */
|
||||
return 1;
|
||||
} else {
|
||||
hdr += 2;
|
||||
}
|
||||
} else {
|
||||
hdr++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* {{{ php_mail
|
||||
*/
|
||||
PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC)
|
||||
@@ -276,6 +314,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
|
||||
|
||||
efree(tmp);
|
||||
}
|
||||
|
||||
if (PG(mail_x_header)) {
|
||||
const char *tmp = zend_get_executed_filename(TSRMLS_C);
|
||||
char *f;
|
||||
@@ -291,6 +330,11 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
|
||||
efree(f);
|
||||
}
|
||||
|
||||
if (hdr && php_mail_detect_multiple_crlf(hdr)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Multiple or malformed newlines found in additional_header");
|
||||
MAIL_RET(0);
|
||||
}
|
||||
|
||||
if (!sendmail_path) {
|
||||
#if (defined PHP_WIN32 || defined NETWARE)
|
||||
/* handle old style win smtp sending */
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Bug #69628: GLOB_BRACE with multiple brackets within the braces fails
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!defined('GLOB_BRACE')) {
|
||||
die('skip this test requires GLOB_BRACE support');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$file_path = dirname(__FILE__);
|
||||
|
||||
// temp dirname used here
|
||||
$dirname = "$file_path/bug69628";
|
||||
|
||||
// temp dir created
|
||||
mkdir($dirname);
|
||||
|
||||
// temp files created
|
||||
file_put_contents("$dirname/image.jPg", '');
|
||||
file_put_contents("$dirname/image.gIf", '');
|
||||
file_put_contents("$dirname/image.png", '');
|
||||
|
||||
sort_var_dump(glob("$dirname/*.{[jJ][pP][gG],[gG][iI][fF]}", GLOB_BRACE));
|
||||
|
||||
function sort_var_dump($results) {
|
||||
sort($results);
|
||||
var_dump($results);
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
|
||||
$file_path = dirname(__FILE__);
|
||||
unlink("$file_path/bug69628/image.jPg");
|
||||
unlink("$file_path/bug69628/image.gIf");
|
||||
unlink("$file_path/bug69628/image.png");
|
||||
rmdir("$file_path/bug69628/");
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s/bug69628/image.gIf"
|
||||
[1]=>
|
||||
string(%d) "%s/bug69628/image.jPg"
|
||||
}
|
||||
@@ -5,6 +5,9 @@ Test glob() function: usage variations
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!defined('GLOB_BRACE')) {
|
||||
die('skip this test requires GLOB_BRACE support');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
--TEST--
|
||||
Test mail() function : basic functionality
|
||||
--INI--
|
||||
sendmail_path=tee mailBasic.out >/dev/null
|
||||
mail.add_x_header = Off
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(substr(PHP_OS, 0, 3) == "WIN")
|
||||
die("skip Won't run on Windows");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
|
||||
* Description: Send an email message with invalid addtional_headers
|
||||
* Source code: ext/standard/mail.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing mail() : basic functionality ***\n";
|
||||
|
||||
|
||||
// Valid header
|
||||
$to = 'user@example.com';
|
||||
$subject = 'Test Subject';
|
||||
$message = 'A Message';
|
||||
$additional_headers = "HEAD1: a\r\nHEAD2: b\r\n";
|
||||
$outFile = "mailBasic.out";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Valid Header --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo file_get_contents($outFile);
|
||||
unlink($outFile);
|
||||
|
||||
// Valid header
|
||||
$additional_headers = "HEAD1: a\nHEAD2: b\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Valid Header --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Valid header
|
||||
// \r is accepted as valid. This may be changed to invalid.
|
||||
$additional_headers = "HEAD1: a\rHEAD2: b\r";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Valid Header --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
//===============================================================================
|
||||
// Invalid header
|
||||
$additional_headers = "\nHEAD1: a\nHEAD2: b\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "\rHEAD1: a\nHEAD2: b\r";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "\r\nHEAD1: a\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "\r\n\r\nHEAD1: a\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "\n\nHEAD1: a\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "\r\rHEAD1: a\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - preceeding newline--\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\r\n\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\r\n\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\n\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\r\rHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\n\rHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
$additional_headers = "HEAD1: a\n\r\nHEAD2: b\r\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - multiple newlines in the middle --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
// Invalid, but PHP_FUNCTION(mail) trims newlines
|
||||
$additional_headers = "HEAD1: a\r\nHEAD2: b\r\n\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - trailing newlines --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
// Invalid, but PHP_FUNCTION(mail) trims newlines
|
||||
$additional_headers = "HEAD1: a\r\nHEAD2: b\n\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - trailing newlines --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
// Invalid, but PHP_FUNCTION(mail) trims newlines
|
||||
$additional_headers = "HEAD1: a\r\nHEAD2: b\n";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - trailing newlines --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
// Invalid header
|
||||
// Invalid, but PHP_FUNCTION(mail) trims newlines
|
||||
$additional_headers = "HEAD1: a\r\nHEAD2: b\r";
|
||||
@unlink($outFile);
|
||||
|
||||
echo "-- Invalid Header - trailing newlines --\n";
|
||||
// Calling mail() with all additional headers
|
||||
var_dump( mail($to, $subject, $message, $additional_headers) );
|
||||
echo @file_get_contents($outFile);
|
||||
@unlink($outFile);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing mail() : basic functionality ***
|
||||
-- Valid Header --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Valid Header --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Valid Header --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - preceeding newline--
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - multiple newlines in the middle --
|
||||
|
||||
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
|
||||
bool(false)
|
||||
-- Invalid Header - trailing newlines --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Invalid Header - trailing newlines --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Invalid Header - trailing newlines --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
-- Invalid Header - trailing newlines --
|
||||
bool(true)
|
||||
To: user@example.com
|
||||
Subject: Test Subject
|
||||
HEAD1: a
|
||||
HEAD2: b
|
||||
|
||||
A Message
|
||||
===DONE===
|
||||
+2
-2
@@ -1868,7 +1868,7 @@ void php_request_shutdown(void *dummy)
|
||||
}
|
||||
} zend_end_try();
|
||||
|
||||
/* 7.5 free last error information */
|
||||
/* 7.5 free last error information and temp dir */
|
||||
if (PG(last_error_message)) {
|
||||
free(PG(last_error_message));
|
||||
PG(last_error_message) = NULL;
|
||||
@@ -1877,6 +1877,7 @@ void php_request_shutdown(void *dummy)
|
||||
free(PG(last_error_file));
|
||||
PG(last_error_file) = NULL;
|
||||
}
|
||||
php_shutdown_temporary_directory();
|
||||
|
||||
/* 7. Shutdown scanner/executor/compiler and restore ini entries */
|
||||
zend_deactivate(TSRMLS_C);
|
||||
@@ -2475,7 +2476,6 @@ void php_module_shutdown(TSRMLS_D)
|
||||
#endif
|
||||
|
||||
php_output_shutdown();
|
||||
php_shutdown_temporary_directory();
|
||||
|
||||
module_initialized = 0;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ static char* temporary_directory;
|
||||
PHPAPI void php_shutdown_temporary_directory(void)
|
||||
{
|
||||
if (temporary_directory) {
|
||||
free(temporary_directory);
|
||||
efree(temporary_directory);
|
||||
temporary_directory = NULL;
|
||||
}
|
||||
}
|
||||
@@ -202,10 +202,10 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
|
||||
if (sys_temp_dir) {
|
||||
int len = strlen(sys_temp_dir);
|
||||
if (len >= 2 && sys_temp_dir[len - 1] == DEFAULT_SLASH) {
|
||||
temporary_directory = zend_strndup(sys_temp_dir, len - 1);
|
||||
temporary_directory = estrndup(sys_temp_dir, len - 1);
|
||||
return temporary_directory;
|
||||
} else if (len >= 1 && sys_temp_dir[len - 1] != DEFAULT_SLASH) {
|
||||
temporary_directory = zend_strndup(sys_temp_dir, len);
|
||||
temporary_directory = estrndup(sys_temp_dir, len);
|
||||
return temporary_directory;
|
||||
}
|
||||
}
|
||||
@@ -222,9 +222,9 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
|
||||
DWORD len = GetTempPath(sizeof(sTemp),sTemp);
|
||||
assert(0 < len); /* should *never* fail! */
|
||||
if (sTemp[len - 1] == DEFAULT_SLASH) {
|
||||
temporary_directory = zend_strndup(sTemp, len - 1);
|
||||
temporary_directory = estrndup(sTemp, len - 1);
|
||||
} else {
|
||||
temporary_directory = zend_strndup(sTemp, len);
|
||||
temporary_directory = estrndup(sTemp, len);
|
||||
}
|
||||
return temporary_directory;
|
||||
}
|
||||
@@ -236,9 +236,9 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
|
||||
int len = strlen(s);
|
||||
|
||||
if (s[len - 1] == DEFAULT_SLASH) {
|
||||
temporary_directory = zend_strndup(s, len - 1);
|
||||
temporary_directory = estrndup(s, len - 1);
|
||||
} else {
|
||||
temporary_directory = zend_strndup(s, len);
|
||||
temporary_directory = estrndup(s, len);
|
||||
}
|
||||
|
||||
return temporary_directory;
|
||||
@@ -247,12 +247,12 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
|
||||
#ifdef P_tmpdir
|
||||
/* Use the standard default temporary directory. */
|
||||
if (P_tmpdir) {
|
||||
temporary_directory = strdup(P_tmpdir);
|
||||
temporary_directory = estrdup(P_tmpdir);
|
||||
return temporary_directory;
|
||||
}
|
||||
#endif
|
||||
/* Shouldn't ever(!) end up here ... last ditch default. */
|
||||
temporary_directory = strdup("/tmp");
|
||||
temporary_directory = estrndup("/tmp", sizeof("/tmp"));
|
||||
return temporary_directory;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -310,6 +310,11 @@ static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define SAPI_POST_HANDLER_BUFSIZ 16384
|
||||
#else
|
||||
# define SAPI_POST_HANDLER_BUFSIZ BUFSIZ
|
||||
#endif
|
||||
SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
|
||||
{
|
||||
zval *arr = (zval *) arg;
|
||||
@@ -320,8 +325,8 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
|
||||
memset(&post_data, 0, sizeof(post_data));
|
||||
|
||||
while (!php_stream_eof(s)) {
|
||||
char buf[BUFSIZ] = {0};
|
||||
size_t len = php_stream_read(s, buf, BUFSIZ);
|
||||
char buf[SAPI_POST_HANDLER_BUFSIZ] = {0};
|
||||
size_t len = php_stream_read(s, buf, SAPI_POST_HANDLER_BUFSIZ);
|
||||
|
||||
if (len && len != (size_t) -1) {
|
||||
smart_str_appendl(&post_data.str, buf, len);
|
||||
@@ -334,7 +339,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
|
||||
}
|
||||
}
|
||||
|
||||
if (len != BUFSIZ){
|
||||
if (len != SAPI_POST_HANDLER_BUFSIZ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -345,6 +350,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef SAPI_POST_HANDLER_BUFSIZ
|
||||
|
||||
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter)
|
||||
{
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
/* edit configure.in to change version number */
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 6
|
||||
#define PHP_RELEASE_VERSION 9
|
||||
#define PHP_RELEASE_VERSION 10
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.6.9"
|
||||
#define PHP_VERSION_ID 50609
|
||||
#define PHP_VERSION "5.6.10"
|
||||
#define PHP_VERSION_ID 50610
|
||||
@@ -1889,11 +1889,11 @@ consult the installation file that came with this distribution, or visit \n\
|
||||
|
||||
zend_first_try {
|
||||
while (fcgi_accept_request(&request) >= 0) {
|
||||
char *primary_script = NULL;
|
||||
request_body_fd = -1;
|
||||
SG(server_context) = (void *) &request;
|
||||
init_request_info(TSRMLS_C);
|
||||
CG(interactive) = 0;
|
||||
char *primary_script = NULL;
|
||||
|
||||
fpm_request_info();
|
||||
|
||||
|
||||
@@ -3131,10 +3131,20 @@ static int lsapi_initSuEXEC()
|
||||
if ( !s_defaultUid || !s_defaultGid )
|
||||
{
|
||||
pw = getpwnam( "nobody" );
|
||||
if ( !s_defaultUid )
|
||||
s_defaultUid = pw->pw_uid;
|
||||
if ( !s_defaultGid )
|
||||
s_defaultGid = pw->pw_gid;
|
||||
if ( pw )
|
||||
{
|
||||
if ( !s_defaultUid )
|
||||
s_defaultUid = pw->pw_uid;
|
||||
if ( !s_defaultGid )
|
||||
s_defaultGid = pw->pw_gid;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !s_defaultUid )
|
||||
s_defaultUid = 10000;
|
||||
if ( !s_defaultGid )
|
||||
s_defaultGid = 10000;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1937,6 +1937,14 @@ function generate_phpize()
|
||||
CJ.WriteLine("var PHP_ZTS =" + '"' + PHP_ZTS + '"');
|
||||
CJ.WriteLine("var PHP_DLL_LIB =" + '"' + get_define('PHPLIB') + '"');
|
||||
CJ.WriteLine("var PHP_DLL =" + '"' + get_define('PHPDLL') + '"');
|
||||
|
||||
/* The corresponding configure options aren't enabled through phpize,
|
||||
thus these dummy declarations are required. */
|
||||
CJ.WriteLine("var PHP_ANALYZER =" + '"no"');
|
||||
CJ.WriteLine("var PHP_PGO =" + '"no"');
|
||||
CJ.WriteLine("var PHP_PGI =" + '"no"');
|
||||
CJ.WriteLine("var PHP_ALL_SHARED =" + '"no"');
|
||||
|
||||
CJ.WriteBlankLines(1);
|
||||
CJ.Close();
|
||||
}
|
||||
|
||||
+4
-2
@@ -293,17 +293,19 @@ globexp2(ptr, pattern, pglob, rv)
|
||||
}
|
||||
|
||||
for (i = 0, pl = pm = ptr; pm <= pe; pm++) {
|
||||
const Char *pb;
|
||||
|
||||
switch (*pm) {
|
||||
case LBRACKET:
|
||||
/* Ignore everything between [] */
|
||||
for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++)
|
||||
for (pb = pm++; *pm != RBRACKET && *pm != EOS; pm++)
|
||||
;
|
||||
if (*pm == EOS) {
|
||||
/*
|
||||
* We could not find a matching RBRACKET.
|
||||
* Ignore and just look for RBRACE
|
||||
*/
|
||||
pm = pl;
|
||||
pm = pb;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in new issue
Block a user