summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_vm_def.h4
-rw-r--r--Zend/zend_vm_execute.h4
-rw-r--r--ext/fileinfo/libmagic.patch4
-rw-r--r--ext/fileinfo/libmagic/apprentice.c2
-rw-r--r--ext/pdo/pdo_stmt.c2
-rw-r--r--ext/simplexml/simplexml.c6
-rw-r--r--ext/sockets/conversions.c3
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/tests/file/stat_variation3-win32.phpt2
-rw-r--r--sapi/cli/php_cli_server.c1
10 files changed, 18 insertions, 12 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8b635970bb..3c5ad27105 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -7992,7 +7992,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, UNUSED|CLASS_FETCH, ANY)
ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
{
- zend_array *args;
+ zend_array *args = NULL;
zend_function *fbc = EX(func);
zval *ret = EX(return_value);
uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS);
@@ -8023,7 +8023,7 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
ZEND_CALL_NUM_ARGS(call) = 2;
ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name);
- if (num_args) {
+ if (args) {
ZVAL_ARR(ZEND_CALL_ARG(call, 2), args);
} else {
ZVAL_EMPTY_ARRAY(ZEND_CALL_ARG(call, 2));
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index d7872068f9..55d6de2deb 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2104,7 +2104,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- zend_array *args;
+ zend_array *args = NULL;
zend_function *fbc = EX(func);
zval *ret = EX(return_value);
uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS);
@@ -2135,7 +2135,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
ZEND_CALL_NUM_ARGS(call) = 2;
ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name);
- if (num_args) {
+ if (args) {
ZVAL_ARR(ZEND_CALL_ARG(call, 2), args);
} else {
ZVAL_EMPTY_ARRAY(ZEND_CALL_ARG(call, 2));
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 6aa369bd05..522bbcc71b 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2018-03-11 01:46:42.000000000 +0100
-+++ libmagic/apprentice.c 2019-04-12 10:04:15.721646341 +0200
++++ libmagic/apprentice.c 2019-04-15 10:57:47.115181746 +0200
@@ -2,7 +2,7 @@
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
@@ -945,7 +945,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- int fd;
- struct stat st;
+ uint32_t *ptr;
-+ uint32_t version, entries, nentries;
++ uint32_t version, entries = 0, nentries;
+ int needsbyteswap;
char *dbname = NULL;
struct magic_map *map;
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 3355d3cc1e..b9bb65898c 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -2954,7 +2954,7 @@ private struct magic_map *
apprentice_map(struct magic_set *ms, const char *fn)
{
uint32_t *ptr;
- uint32_t version, entries, nentries;
+ uint32_t version, entries = 0, nentries;
int needsbyteswap;
char *dbname = NULL;
struct magic_map *map;
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index f5881c1e6c..8919d99942 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -820,7 +820,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
{
int flags, idx, old_arg_count = 0;
zend_class_entry *ce = NULL, *old_ce = NULL;
- zval grp_val, *pgrp, retval, old_ctor_args;
+ zval grp_val, *pgrp, retval, old_ctor_args = {0};
int colno;
if (how == PDO_FETCH_USE_DEFAULT) {
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index cf459311b7..7925acb334 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1024,6 +1024,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */
zval iter_data;
int test;
int is_empty;
+ int use_iter = 0;
sxe = php_sxe_fetch_object(object);
@@ -1060,6 +1061,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */
ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data);
ZVAL_UNDEF(&sxe->iter.data);
node = php_sxe_reset_iterator(sxe, 0);
+ use_iter = 1;
}
}
@@ -1088,7 +1090,7 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */
is_empty = 0;
break;
next_iter:
- if (!Z_ISUNDEF(iter_data)) {
+ if (use_iter) {
node = php_sxe_iterator_fetch(sxe, node->next, 0);
} else {
node = node->next;
@@ -1096,7 +1098,7 @@ next_iter:
}
}
- if (!Z_ISUNDEF(iter_data)) {
+ if (use_iter) {
if (!Z_ISUNDEF(sxe->iter.data)) {
zval_ptr_dtor(&sxe->iter.data);
}
diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c
index 6eede2b20a..a9f287a8ea 100644
--- a/ext/sockets/conversions.c
+++ b/ext/sockets/conversions.c
@@ -701,6 +701,9 @@ static void from_zval_write_sockaddr_aux(const zval *container,
zval *elem;
int fill_sockaddr;
+ *sockaddr_ptr = NULL;
+ *sockaddr_len = 0;
+
if (Z_TYPE_P(container) != IS_ARRAY) {
do_from_zval_err(ctx, "%s", "expected an array here");
return;
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 36fe523d92..053f8417ec 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -181,7 +181,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
int fd = -1;
int mode_rw = 0;
php_stream * stream = NULL;
- char *p, *token, *pathdup;
+ char *p, *token = NULL, *pathdup;
zend_long max_memory;
FILE *file = NULL;
#ifdef PHP_WIN32
diff --git a/ext/standard/tests/file/stat_variation3-win32.phpt b/ext/standard/tests/file/stat_variation3-win32.phpt
index 2633fd60b8..d08612fc7f 100644
--- a/ext/standard/tests/file/stat_variation3-win32.phpt
+++ b/ext/standard/tests/file/stat_variation3-win32.phpt
@@ -54,7 +54,7 @@ $new_stat1 = stat($dirname);
// compare self stats
var_dump( compare_self_stat($new_stat1) );
// compare the stats
-var_dump(compare_stats($new_stat, $new_stat1, $all_stat_keys, "=="));
+var_dump(compare_stats($new_stat, $new_stat1, $affected_members, "<"));
clearstatcache();
echo "\n*** Done ***";
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 46ba86e9c2..6889278bca 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1448,6 +1448,7 @@ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath
char *p;
*retval = NULL;
+ *retval_len = 0;
decoded_vpath = pestrndup(vpath, vpath_len, persistent);
if (!decoded_vpath) {