summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_API.c11
-rw-r--r--Zend/zend_API.h3
-rw-r--r--Zend/zend_vm_def.h96
-rw-r--r--Zend/zend_vm_execute.h384
-rw-r--r--ext/bz2/bz2.c6
-rwxr-xr-xext/com_dotnet/com_persist.c4
-rw-r--r--ext/dom/document.c4
-rwxr-xr-xext/enchant/enchant.c2
-rw-r--r--ext/exif/exif.c4
-rw-r--r--ext/fileinfo/fileinfo.c2
-rw-r--r--ext/ftp/php_ftp.c14
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/gd/gd_ctx.c2
-rw-r--r--ext/hash/hash.c3
-rw-r--r--ext/hash/hash_md.c2
-rw-r--r--ext/hash/hash_sha.c2
-rw-r--r--ext/imap/php_imap.c2
-rw-r--r--ext/oci8/oci8_interface.c18
-rw-r--r--ext/odbc/php_odbc.c4
-rw-r--r--ext/openssl/openssl.c16
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c4
-rw-r--r--ext/pgsql/pgsql.c16
-rw-r--r--ext/phar/func_interceptors.c14
-rw-r--r--ext/posix/posix.c6
-rw-r--r--ext/pspell/pspell.c6
-rw-r--r--ext/readline/readline.c4
-rw-r--r--ext/simplexml/simplexml.c4
-rw-r--r--ext/snmp/snmp.c2
-rwxr-xr-xext/spl/spl_directory.c2
-rw-r--r--ext/sqlite3/sqlite3.c2
-rw-r--r--ext/standard/basic_functions.c6
-rw-r--r--ext/standard/dir.c6
-rw-r--r--ext/standard/file.c10
-rw-r--r--ext/standard/filestat.c16
-rw-r--r--ext/standard/ftok.c2
-rw-r--r--ext/standard/iptc.c2
-rw-r--r--ext/standard/link.c6
-rw-r--r--ext/standard/link_win32.c6
-rw-r--r--ext/standard/md5.c2
-rw-r--r--ext/standard/sha1.c2
-rw-r--r--ext/tidy/tidy.c8
-rw-r--r--ext/xmlreader/php_xmlreader.c6
-rw-r--r--ext/xsl/xsltprocessor.c4
-rw-r--r--ext/zip/php_zip.c18
-rw-r--r--ext/zlib/zlib.c2
-rw-r--r--main/fopen_wrappers.c2
-rw-r--r--sapi/apache/php_apache.c2
-rw-r--r--sapi/apache2filter/php_functions.c4
-rw-r--r--sapi/apache2handler/php_functions.c4
49 files changed, 400 insertions, 351 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index ff7d8dfd66..cd5e52f20d 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -406,6 +406,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
}
break;
+ case 'p':
case 's':
{
char **p = va_arg(*va, char **);
@@ -432,17 +433,23 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
}
*p = Z_STRVAL_PP(arg);
*pl = Z_STRLEN_PP(arg);
+ if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
+ return "valid path";
+ }
break;
case IS_OBJECT:
if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
+ return "valid path";
+ }
break;
}
case IS_ARRAY:
case IS_RESOURCE:
default:
- return "string";
+ return c == 's' ? "string" : "valid path";
}
}
break;
@@ -708,7 +715,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
case 'z': case 'Z':
case 'C': case 'h':
case 'f': case 'A':
- case 'H':
+ case 'H': case 'p':
max_num_args++;
break;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index f75ce5038b..db040f6be4 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -526,6 +526,9 @@ END_EXTERN_C()
#define CHECK_ZVAL_STRING_REL(z)
#endif
+#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
+#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
+
#define ZVAL_RESOURCE(z, l) do { \
zval *__z = (z); \
Z_LVAL_P(__z) = l; \
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index a76352799a..c25b7a7a74 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3637,58 +3637,66 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
inc_filename = &tmp_inc_filename;
}
- switch (opline->extended_value) {
- case ZEND_INCLUDE_ONCE:
- case ZEND_REQUIRE_ONCE: {
- zend_file_handle file_handle;
- char *resolved_path;
-
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
- if (resolved_path) {
- failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
- } else {
- resolved_path = Z_STRVAL_P(inc_filename);
- }
+ if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
+ } else {
+ switch (opline->extended_value) {
+ case ZEND_INCLUDE_ONCE:
+ case ZEND_REQUIRE_ONCE: {
+ zend_file_handle file_handle;
+ char *resolved_path;
+
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ if (resolved_path) {
+ failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
+ } else {
+ resolved_path = Z_STRVAL_P(inc_filename);
+ }
- if (failure_retval) {
- /* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ if (failure_retval) {
+ /* do nothing, file already included */
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
- if (!file_handle.opened_path) {
- file_handle.opened_path = estrdup(resolved_path);
- }
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrdup(resolved_path);
+ }
- if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ failure_retval=1;
+ }
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
- failure_retval=1;
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
}
- } else {
- if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
- } else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ if (resolved_path != Z_STRVAL_P(inc_filename)) {
+ efree(resolved_path);
}
}
- if (resolved_path != Z_STRVAL_P(inc_filename)) {
- efree(resolved_path);
- }
- }
- break;
- case ZEND_INCLUDE:
- case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
- break;
- case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ break;
+ case ZEND_INCLUDE:
+ case ZEND_REQUIRE:
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ break;
+ case ZEND_EVAL: {
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
- efree(eval_desc);
- }
- break;
- EMPTY_SWITCH_DEFAULT_CASE()
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ efree(eval_desc);
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE()
+ }
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 899aa572bd..63db4987d6 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2285,58 +2285,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
inc_filename = &tmp_inc_filename;
}
- switch (opline->extended_value) {
- case ZEND_INCLUDE_ONCE:
- case ZEND_REQUIRE_ONCE: {
- zend_file_handle file_handle;
- char *resolved_path;
-
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
- if (resolved_path) {
- failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
- } else {
- resolved_path = Z_STRVAL_P(inc_filename);
- }
-
- if (failure_retval) {
- /* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
+ } else {
+ switch (opline->extended_value) {
+ case ZEND_INCLUDE_ONCE:
+ case ZEND_REQUIRE_ONCE: {
+ zend_file_handle file_handle;
+ char *resolved_path;
- if (!file_handle.opened_path) {
- file_handle.opened_path = estrdup(resolved_path);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ if (resolved_path) {
+ failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
+ } else {
+ resolved_path = Z_STRVAL_P(inc_filename);
}
- if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ if (failure_retval) {
+ /* do nothing, file already included */
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrdup(resolved_path);
+ }
+
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ failure_retval=1;
+ }
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
- failure_retval=1;
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
}
- } else {
- if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
- } else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ if (resolved_path != Z_STRVAL_P(inc_filename)) {
+ efree(resolved_path);
}
}
- if (resolved_path != Z_STRVAL_P(inc_filename)) {
- efree(resolved_path);
- }
- }
- break;
- case ZEND_INCLUDE:
- case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
- break;
- case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ break;
+ case ZEND_INCLUDE:
+ case ZEND_REQUIRE:
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ break;
+ case ZEND_EVAL: {
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
- efree(eval_desc);
- }
- break;
- EMPTY_SWITCH_DEFAULT_CASE()
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ efree(eval_desc);
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE()
+ }
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
@@ -6538,58 +6546,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
inc_filename = &tmp_inc_filename;
}
- switch (opline->extended_value) {
- case ZEND_INCLUDE_ONCE:
- case ZEND_REQUIRE_ONCE: {
- zend_file_handle file_handle;
- char *resolved_path;
-
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
- if (resolved_path) {
- failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
- } else {
- resolved_path = Z_STRVAL_P(inc_filename);
- }
-
- if (failure_retval) {
- /* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
+ } else {
+ switch (opline->extended_value) {
+ case ZEND_INCLUDE_ONCE:
+ case ZEND_REQUIRE_ONCE: {
+ zend_file_handle file_handle;
+ char *resolved_path;
- if (!file_handle.opened_path) {
- file_handle.opened_path = estrdup(resolved_path);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ if (resolved_path) {
+ failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
+ } else {
+ resolved_path = Z_STRVAL_P(inc_filename);
}
- if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ if (failure_retval) {
+ /* do nothing, file already included */
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrdup(resolved_path);
+ }
+
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ failure_retval=1;
+ }
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
- failure_retval=1;
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
}
- } else {
- if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
- } else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ if (resolved_path != Z_STRVAL_P(inc_filename)) {
+ efree(resolved_path);
}
}
- if (resolved_path != Z_STRVAL_P(inc_filename)) {
- efree(resolved_path);
- }
- }
- break;
- case ZEND_INCLUDE:
- case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
- break;
- case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ break;
+ case ZEND_INCLUDE:
+ case ZEND_REQUIRE:
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ break;
+ case ZEND_EVAL: {
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
- efree(eval_desc);
- }
- break;
- EMPTY_SWITCH_DEFAULT_CASE()
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ efree(eval_desc);
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE()
+ }
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
@@ -10817,58 +10833,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
inc_filename = &tmp_inc_filename;
}
- switch (opline->extended_value) {
- case ZEND_INCLUDE_ONCE:
- case ZEND_REQUIRE_ONCE: {
- zend_file_handle file_handle;
- char *resolved_path;
-
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
- if (resolved_path) {
- failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
- } else {
- resolved_path = Z_STRVAL_P(inc_filename);
- }
-
- if (failure_retval) {
- /* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
+ } else {
+ switch (opline->extended_value) {
+ case ZEND_INCLUDE_ONCE:
+ case ZEND_REQUIRE_ONCE: {
+ zend_file_handle file_handle;
+ char *resolved_path;
- if (!file_handle.opened_path) {
- file_handle.opened_path = estrdup(resolved_path);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ if (resolved_path) {
+ failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
+ } else {
+ resolved_path = Z_STRVAL_P(inc_filename);
}
- if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ if (failure_retval) {
+ /* do nothing, file already included */
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrdup(resolved_path);
+ }
+
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ failure_retval=1;
+ }
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
- failure_retval=1;
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
}
- } else {
- if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
- } else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ if (resolved_path != Z_STRVAL_P(inc_filename)) {
+ efree(resolved_path);
}
}
- if (resolved_path != Z_STRVAL_P(inc_filename)) {
- efree(resolved_path);
- }
- }
- break;
- case ZEND_INCLUDE:
- case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
- break;
- case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ break;
+ case ZEND_INCLUDE:
+ case ZEND_REQUIRE:
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ break;
+ case ZEND_EVAL: {
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
- efree(eval_desc);
- }
- break;
- EMPTY_SWITCH_DEFAULT_CASE()
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ efree(eval_desc);
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE()
+ }
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
@@ -26478,58 +26502,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
inc_filename = &tmp_inc_filename;
}
- switch (opline->extended_value) {
- case ZEND_INCLUDE_ONCE:
- case ZEND_REQUIRE_ONCE: {
- zend_file_handle file_handle;
- char *resolved_path;
-
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
- if (resolved_path) {
- failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
- } else {
- resolved_path = Z_STRVAL_P(inc_filename);
- }
-
- if (failure_retval) {
- /* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
+ } else {
+ switch (opline->extended_value) {
+ case ZEND_INCLUDE_ONCE:
+ case ZEND_REQUIRE_ONCE: {
+ zend_file_handle file_handle;
+ char *resolved_path;
- if (!file_handle.opened_path) {
- file_handle.opened_path = estrdup(resolved_path);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ if (resolved_path) {
+ failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
+ } else {
+ resolved_path = Z_STRVAL_P(inc_filename);
}
- if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ if (failure_retval) {
+ /* do nothing, file already included */
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrdup(resolved_path);
+ }
+
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ failure_retval=1;
+ }
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
- failure_retval=1;
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ } else {
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ }
}
- } else {
- if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
- } else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ if (resolved_path != Z_STRVAL_P(inc_filename)) {
+ efree(resolved_path);
}
}
- if (resolved_path != Z_STRVAL_P(inc_filename)) {
- efree(resolved_path);
- }
- }
- break;
- case ZEND_INCLUDE:
- case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
- break;
- case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ break;
+ case ZEND_INCLUDE:
+ case ZEND_REQUIRE:
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ break;
+ case ZEND_EVAL: {
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
- efree(eval_desc);
- }
- break;
- EMPTY_SWITCH_DEFAULT_CASE()
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ efree(eval_desc);
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE()
+ }
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index dafe4b25ab..1e3c7b7617 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -385,12 +385,14 @@ static PHP_FUNCTION(bzopen)
/* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_PP(file) == IS_STRING) {
- convert_to_string_ex(file);
-
if (Z_STRLEN_PP(file) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
RETURN_FALSE;
}
+
+ if (CHECK_ZVAL_NULL_PATH(*file)) {
+ RETURN_FALSE;
+ }
stream = php_stream_bz2open(NULL,
Z_STRVAL_PP(file),
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 56611987b2..c72bf622a4 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -379,7 +379,7 @@ CPH_METHOD(SaveToFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
&filename, &filename_len, &remember)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
@@ -443,7 +443,7 @@ CPH_METHOD(LoadFromFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
&filename, &filename_len, &flags)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 6499b55f64..e01e2c34d6 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -1979,7 +1979,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(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
return;
}
@@ -2068,7 +2068,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(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
return;
}
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index bfac6f57c5..81404db53a 100755
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -587,7 +587,7 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
int pwllen;
int pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 04abb953b1..f5e8374845 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3938,7 +3938,7 @@ PHP_FUNCTION(exif_read_data)
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
return;
}
@@ -4119,7 +4119,7 @@ PHP_FUNCTION(exif_thumbnail)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(arg_c TSRMLS_CC, "s|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
+ if (zend_parse_parameters(arg_c TSRMLS_CC, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
return;
}
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index e5d28e88ce..613c043771 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -286,7 +286,7 @@ PHP_FUNCTION(finfo_open)
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lp", &options, &file, &file_len) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index e62243e949..6c44733fed 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -607,7 +607,7 @@ PHP_FUNCTION(ftp_chmod)
int filename_len;
long mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
@@ -660,7 +660,7 @@ PHP_FUNCTION(ftp_nlist)
char **nlist, **ptr, *dir;
int dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -857,7 +857,7 @@ PHP_FUNCTION(ftp_get)
int local_len, remote_len;
long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -1124,7 +1124,7 @@ PHP_FUNCTION(ftp_put)
long mode, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(ftp_nb_put)
long mode, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1233,7 +1233,7 @@ PHP_FUNCTION(ftp_size)
char *file;
int file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1253,7 +1253,7 @@ PHP_FUNCTION(ftp_mdtm)
char *file;
int file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 38abecdd3a..1fe321773c 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -2673,7 +2673,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
/* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */
/* The quality parameter for gd2 stands for chunk size */
- if (zend_parse_parameters(argc TSRMLS_CC, "r|sll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
+ if (zend_parse_parameters(argc TSRMLS_CC, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
return;
}
@@ -4592,7 +4592,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
long ignore_warning;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sslll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
+ 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;
}
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 15319c1a78..6ee174db74 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -93,7 +93,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* from imagey<type>().
*/
if (image_type == PHP_GDIMG_TYPE_XBM) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
return;
}
} else {
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index e994e9e157..1c2d4241c4 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -141,6 +141,9 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
RETURN_FALSE;
}
if (isfilename) {
+ if (CHECK_NULL_PATH(data, data_len)) {
+ RETURN_FALSE;
+ }
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
if (!stream) {
/* Stream will report errors opening file */
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index 6d9f0518b9..4e7ca28204 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -144,7 +144,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index 991d7db404..6e58c444dc 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -128,7 +128,7 @@ PHP_FUNCTION(sha1_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 819ef51b6d..34fae16763 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1153,7 +1153,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zval *params = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "sss|lla", &mailbox, &mailbox_len, &user, &user_len,
+ if (zend_parse_parameters(argc TSRMLS_CC, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
&passwd, &passwd_len, &flags, &retries, &params) == FAILURE) {
return;
}
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 699eccb4a2..b1d454e612 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -233,21 +233,16 @@ PHP_FUNCTION(oci_lob_import)
int filename_len;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
return;
}
}
- if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
- RETURN_FALSE;
- }
-
if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
@@ -872,7 +867,7 @@ PHP_FUNCTION(oci_lob_export)
ub4 lob_length;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
return;
}
@@ -886,7 +881,7 @@ PHP_FUNCTION(oci_lob_export)
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
return;
}
@@ -900,11 +895,6 @@ PHP_FUNCTION(oci_lob_export)
}
}
- if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
- RETURN_FALSE;
- }
-
if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index a036d3b7a7..5275a35b45 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1317,6 +1317,10 @@ PHP_FUNCTION(odbc_execute)
if (Z_STRLEN_PP(tmp) > 2 &&
Z_STRVAL_PP(tmp)[0] == '\'' &&
Z_STRVAL_PP(tmp)[Z_STRLEN_PP(tmp) - 1] == '\'') {
+
+ if (CHECK_ZVAL_NULL_PATH(*tmp)) {
+ RETURN_FALSE;
+ }
filename = estrndup(&Z_STRVAL_PP(tmp)[1], Z_STRLEN_PP(tmp) - 2);
filename[strlen(filename)] = '\0';
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 4377d2b52e..0c61b5a254 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1259,7 +1259,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
char * filename;
int filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -1808,7 +1808,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
zval ** item;
STACK_OF(X509) *ca = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zszs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
return;
RETVAL_FALSE;
@@ -2255,7 +2255,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
BIO * bio_out;
long csr_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3039,7 +3039,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
BIO * bio_out = NULL;
const EVP_CIPHER * cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zṕ|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3327,7 +3327,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
RETVAL_LONG(-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|sass", &filename, &filename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|papp", &filename, &filename_len,
&flags, &signersfilename, &signersfilename_len, &cainfo,
&extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) {
return;
@@ -3440,7 +3440,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZa!|ll", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZa!|ll", &infilename, &infilename_len,
&outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE)
return;
@@ -3576,7 +3576,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
char * outfilename; int outfilename_len;
char * extracertsfilename = NULL; int extracertsfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZZa!|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp",
&infilename, &infilename_len, &outfilename, &outfilename_len,
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
&extracertsfilename_len) == FAILURE) {
@@ -3680,7 +3680,7 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
char * infilename; int infilename_len;
char * outfilename; int outfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZ|Z", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZ|Z", &infilename, &infilename_len,
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
return;
}
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 72f811eb3a..45f05fa2c7 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -628,7 +628,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
ExecStatusType status;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -722,7 +722,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile)
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index d321ec4883..9ab1a071e6 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3322,17 +3322,17 @@ PHP_FUNCTION(pg_lo_import)
Oid returned_oid;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "rs|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
+ "rp|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
;
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "s|z", &file_in, &name_len, &oid) == SUCCESS) {
+ "p|z", &file_in, &name_len, &oid) == SUCCESS) {
id = PGG(default_link);
CHECK_DEFAULT_LINK(id);
}
/* old calling convention, deprecated since PHP 4.2 */
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "sr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
+ "pr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
}
else {
@@ -3412,7 +3412,7 @@ PHP_FUNCTION(pg_lo_export)
/* allow string to handle large OID value correctly */
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "rls", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
+ "rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
@@ -3429,7 +3429,7 @@ PHP_FUNCTION(pg_lo_export)
}
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "ls", &oid_long, &file_out, &name_len) == SUCCESS) {
+ "lp", &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
@@ -3439,7 +3439,7 @@ PHP_FUNCTION(pg_lo_export)
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "ss", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
+ "sp", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
@@ -3450,7 +3450,7 @@ PHP_FUNCTION(pg_lo_export)
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "ssr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
+ "spr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
@@ -3459,7 +3459,7 @@ PHP_FUNCTION(pg_lo_export)
}
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
- "lsr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
+ "lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
if (oid_long <= InvalidOid) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 353bc47072..1b3f0f461b 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -38,7 +38,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
goto skip_phar;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
@@ -113,7 +113,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
}
/* Parse arguments */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
goto skip_phar;
}
@@ -244,7 +244,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
&& !cached_phars.arBuckets) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -340,7 +340,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
/* no need to check, include_path not even specified in fopen/ no active phars */
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ss|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -813,7 +813,7 @@ void fname(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
int filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
@@ -905,7 +905,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
&& !cached_phars.arBuckets) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
@@ -972,7 +972,7 @@ PHAR_FUNC(phar_is_link) /* {{{ */
&& !cached_phars.arBuckets) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 3ac1dc4dfd..580911afa6 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -838,7 +838,7 @@ PHP_FUNCTION(posix_mkfifo)
long mode;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -871,7 +871,7 @@ PHP_FUNCTION(posix_mknod)
php_dev = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ll", &path, &path_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
&mode, &major, &minor) == FAILURE) {
RETURN_FALSE;
}
@@ -951,7 +951,7 @@ PHP_FUNCTION(posix_access)
int filename_len, ret;
char *filename, *path;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index fe6c95bb41..abdded3fd2 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -374,7 +374,7 @@ static PHP_FUNCTION(pspell_new_personal)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|sssl", &personal, &personal_len, &language, &language_len,
+ if (zend_parse_parameters(argc TSRMLS_CC, "ps|sssl", &personal, &personal_len, &language, &language_len,
&spelling, &spelling_len, &jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
return;
}
@@ -825,7 +825,7 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
int value_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &conf, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &value, &value_len) == FAILURE) {
return;
}
@@ -874,7 +874,7 @@ static PHP_FUNCTION(pspell_config_repl)
int repl_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &conf, &repl, &repl_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &repl, &repl_len) == FAILURE) {
return;
}
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index c47491c199..d199cdf517 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -378,7 +378,7 @@ PHP_FUNCTION(readline_read_history)
char *arg = NULL;
int arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
return;
}
@@ -398,7 +398,7 @@ PHP_FUNCTION(readline_write_history)
char *arg = NULL;
int arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
return;
}
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 98dbc0c13e..1d74853cd9 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1365,7 +1365,7 @@ SXE_METHOD(asXML)
}
if (ZEND_NUM_ARGS() == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
@@ -2148,7 +2148,7 @@ PHP_FUNCTION(simplexml_load_file)
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index d9a2a03231..e99d5090e5 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1682,7 +1682,7 @@ PHP_FUNCTION(snmp_read_mib)
char *filename;
int filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 4cb3aece62..f1eaffe479 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -2238,7 +2238,7 @@ SPL_METHOD(SplFileObject, __construct)
intern->u.file.open_mode = NULL;
intern->u.file.open_mode_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbr",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr",
&intern->file_name, &intern->file_name_len,
&intern->u.file.open_mode, &intern->u.file.open_mode_len,
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index d54eb7c567..9c922414b8 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -103,7 +103,7 @@ PHP_METHOD(sqlite3, open)
db_obj = (php_sqlite3_db_object *)zend_object_store_get_object(object TSRMLS_CC);
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index b56f85caee..698234fe6e 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -5093,7 +5093,7 @@ PHP_FUNCTION(highlight_file)
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) {
RETURN_FALSE;
}
@@ -5134,7 +5134,7 @@ PHP_FUNCTION(php_strip_whitespace)
zend_lex_state original_lex_state;
zend_file_handle file_handle = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
@@ -5864,7 +5864,7 @@ PHP_FUNCTION(parse_ini_file)
zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 284553beaf..746cd8e238 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -325,7 +325,7 @@ PHP_FUNCTION(chdir)
char *str;
int ret, str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
@@ -436,7 +436,7 @@ PHP_FUNCTION(glob)
int ret;
zend_bool basedir_limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
return;
}
@@ -554,7 +554,7 @@ PHP_FUNCTION(scandir)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
return;
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 868fbab4da..c3f167b807 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -831,7 +831,7 @@ PHP_FUNCTION(tempnam)
char *p;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
return;
}
@@ -885,7 +885,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
php_stream *stream;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -939,7 +939,7 @@ PHP_FUNCTION(popen)
php_stream *stream;
char *posix_mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &command, &command_len, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
return;
}
@@ -1636,7 +1636,7 @@ PHP_FUNCTION(copy)
zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
@@ -2331,7 +2331,7 @@ PHP_FUNCTION(realpath)
int filename_len;
char resolved_path_buff[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 34b6468146..5c4c5d465e 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -235,7 +235,7 @@ PHP_FUNCTION(disk_total_space)
char *path;
int path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
return;
}
@@ -370,7 +370,7 @@ PHP_FUNCTION(disk_free_space)
char *path;
int path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
return;
}
@@ -425,7 +425,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
int ret;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", &filename, &filename_len, &group) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &group) == FAILURE) {
RETURN_FALSE;
}
@@ -556,7 +556,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
int ret;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", &filename, &filename_len, &user) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &user) == FAILURE) {
return;
}
@@ -659,7 +659,7 @@ PHP_FUNCTION(chmod)
mode_t imode;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &filename, &filename_len, &mode) == FAILURE) {
return;
}
@@ -707,7 +707,7 @@ PHP_FUNCTION(touch)
struct utimbuf *newtime = &newtimebuf;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
+ if (zend_parse_parameters(argc TSRMLS_CC, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
return;
}
@@ -817,7 +817,7 @@ PHP_FUNCTION(clearstatcache)
char *filename = NULL;
int filename_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bs", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
return;
}
@@ -1068,7 +1068,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
int filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 809a1e078a..8486eb12c7 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -35,7 +35,7 @@ PHP_FUNCTION(ftok)
int pathname_len, proj_len;
key_t k;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
return;
}
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 6da54ccc17..4cac5e0921 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -187,7 +187,7 @@ PHP_FUNCTION(iptcembed)
struct stat sb;
zend_bool written = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
return;
}
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 6c0e1cf15d..f6d474009d 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -89,7 +89,7 @@ PHP_FUNCTION(linkinfo)
struct stat sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
return;
}
@@ -115,7 +115,7 @@ PHP_FUNCTION(symlink)
char dirname[MAXPATHLEN];
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
@@ -171,7 +171,7 @@ PHP_FUNCTION(link)
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index c5357c7e18..d7589bbb7b 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(readlink)
int link_len;
char target[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
return;
}
@@ -90,7 +90,7 @@ PHP_FUNCTION(linkinfo)
struct stat sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
return;
}
@@ -133,7 +133,7 @@ PHP_FUNCTION(symlink)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index 36e49ce44c..0c35577768 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -85,7 +85,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index 3b552de789..2c7cd3e3e0 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -75,7 +75,7 @@ PHP_FUNCTION(sha1_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index f51f0b4579..cf8e290569 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -558,7 +558,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
TidyBuffer *errbuf;
zval **config = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1272,7 +1272,7 @@ static PHP_FUNCTION(tidy_parse_file)
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1586,7 +1586,7 @@ static TIDY_DOC_METHOD(__construct)
PHPTidyObj *obj;
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sZsb", &inputfile, &input_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|pZsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1620,7 +1620,7 @@ static TIDY_DOC_METHOD(parseFile)
obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index b9f6348c04..83d8f5ca8d 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -495,7 +495,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
xmlRelaxNGPtr schema = NULL;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
return;
}
@@ -872,7 +872,7 @@ PHP_METHOD(xmlreader, open)
char resolved_path[MAXPATHLEN + 1];
xmlTextReaderPtr reader = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
@@ -958,7 +958,7 @@ PHP_METHOD(xmlreader, setSchema)
xmlreader_object *intern;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
return;
}
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 2ac2c4bbe1..8cb3415167 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -634,7 +634,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os", &docp, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "op", &docp, &uri, &uri_len) == FAILURE) {
RETURN_FALSE;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
int filename_len;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s!", &filename, &filename_len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p!", &filename, &filename_len) == SUCCESS) {
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern->profiling) {
efree(intern->profiling);
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 56abd80beb..3aa3988e8e 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1211,7 +1211,7 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
zip_rsrc *rsrc_int;
int err = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
@@ -1495,7 +1495,7 @@ static ZIPARCHIVE_METHOD(open)
zval *this = getThis();
ze_zip_object *ze_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &flags) == FAILURE) {
return;
}
@@ -1664,12 +1664,12 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
ZIP_FROM_OBJECT(intern, this);
/* 1 == glob, 2==pcre */
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|la",
&pattern, &pattern_len, &flags, &options) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sa",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sa",
&pattern, &pattern_len, &path, &path_len, &options) == FAILURE) {
return;
}
@@ -1783,7 +1783,7 @@ static ZIPARCHIVE_METHOD(addFile)
ZIP_FROM_OBJECT(intern, this);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sll",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sll",
&filename, &filename_len, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
return;
}
@@ -1882,7 +1882,7 @@ static ZIPARCHIVE_METHOD(statName)
ZIP_FROM_OBJECT(intern, this);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
&name, &name_len, &flags) == FAILURE) {
return;
}
@@ -1938,7 +1938,7 @@ static ZIPARCHIVE_METHOD(locateName)
ZIP_FROM_OBJECT(intern, this);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
&name, &name_len, &flags) == FAILURE) {
return;
}
@@ -2518,7 +2518,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ZIP_FROM_OBJECT(intern, this);
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &len, &flags) == FAILURE) {
return;
}
PHP_ZIP_STAT_PATH(intern, filename, filename_len, flags, sb);
@@ -2594,7 +2594,7 @@ static ZIPARCHIVE_METHOD(getStream)
ZIP_FROM_OBJECT(intern, this);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 8a14f3b78f..08450a3aa3 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -431,7 +431,7 @@ static PHP_FUNCTION(gzfile)
long use_include_path = 0;
php_stream *stream;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &use_include_path)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &use_include_path)) {
return;
}
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 4ec3e5ee7a..812d591767 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -477,7 +477,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
char *actual_path;
php_stream_wrapper *wrapper;
- if (!filename) {
+ if (!filename || CHECK_NULL_PATH(filename, filename_length)) {
return NULL;
}
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 58f1c1a5bc..d2159e9789 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -350,7 +350,7 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c
index 68beefc8f1..0d0a294bed 100644
--- a/sapi/apache2filter/php_functions.c
+++ b/sapi/apache2filter/php_functions.c
@@ -63,7 +63,7 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
@@ -101,7 +101,7 @@ PHP_FUNCTION(apache_lookup_uri)
char *filename;
int filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index dbad4995d0..65f913a217 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -75,7 +75,7 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}
@@ -121,7 +121,7 @@ PHP_FUNCTION(apache_lookup_uri)
char *filename;
int filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
return;
}