From 95181553c84d5d02fbae773e2d4fc63fcf15ba23 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Tue, 8 Oct 2019 01:27:38 +0200 Subject: [PATCH] Add missing zend_parse_parameters_none() checks Closes GH-4796. --- ext/hash/hash.c | 4 ++++ ext/openssl/openssl.c | 4 ++++ ext/standard/basic_functions.c | 8 ++++++++ ext/standard/info.c | 2 +- ext/standard/math.c | 4 ++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 8247561758..6b869affde 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -616,6 +616,10 @@ PHP_FUNCTION(hash_hmac_algos) zend_string *str; const php_hash_ops *ops; + if (zend_parse_parameters_none() == FAILURE) { + return; + } + array_init(return_value); ZEND_HASH_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) { if (ops->is_crypto) { diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index d342f1e71a..912c57f709 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1626,6 +1626,10 @@ PHP_MSHUTDOWN_FUNCTION(openssl) Retrieve an array mapping available certificate locations */ PHP_FUNCTION(openssl_get_cert_locations) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + array_init(return_value); add_assoc_string(return_value, "default_cert_file", (char *) X509_get_default_cert_file()); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 921c704288..01071dd244 100755 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4636,6 +4636,10 @@ PHP_FUNCTION(print_r) Returns true if client disconnected */ PHP_FUNCTION(connection_aborted) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED); } /* }}} */ @@ -4644,6 +4648,10 @@ PHP_FUNCTION(connection_aborted) Returns the connection status bitfield */ PHP_FUNCTION(connection_status) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_LONG(PG(connection_status)); } /* }}} */ diff --git a/ext/standard/info.c b/ext/standard/info.c index 81bd897a25..bb3c71d9b5 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1322,7 +1322,7 @@ PHP_FUNCTION(php_sapi_name) /* }}} */ -/* {{{ proto string php_uname(void) +/* {{{ proto string php_uname([ string $mode = "a"]) Return information about the system PHP was built on */ PHP_FUNCTION(php_uname) { diff --git a/ext/standard/math.c b/ext/standard/math.c index f903615d75..b2e56f5a27 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -570,6 +570,10 @@ PHP_FUNCTION(atanh) Returns an approximation of pi */ PHP_FUNCTION(pi) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_DOUBLE(M_PI); } /* }}} */ -- 2.40.0