summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-06-18 09:26:09 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-06-18 13:26:32 +0200
commited6fbf91746e4c807e36f3b09a24f04298ec6b71 (patch)
tree4aad935f520452a5845272eda60401ce310d41a0 /ext/curl/interface.c
parenta43fd3bbef313c880b8acbeac7babef074471e31 (diff)
downloadphp-git-ed6fbf91746e4c807e36f3b09a24f04298ec6b71.tar.gz
Fix UNKNOWN default values in ext/curl
Closes GH-5734
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 7e9cbf2fdf..85ac0f0b30 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1861,7 +1861,7 @@ PHP_FUNCTION(curl_init)
ZEND_PARSE_PARAMETERS_START(0,1)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(url)
+ Z_PARAM_STR_OR_NULL(url)
ZEND_PARSE_PARAMETERS_END();
cp = curl_easy_init();
@@ -3008,17 +3008,18 @@ PHP_FUNCTION(curl_getinfo)
{
zval *zid;
php_curl *ch;
- zend_long option = 0;
+ zend_long option;
+ zend_bool option_is_null = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_OBJECT_OF_CLASS(zid, curl_ce)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(option)
+ Z_PARAM_LONG_OR_NULL(option, option_is_null)
ZEND_PARSE_PARAMETERS_END();
ch = Z_CURL_P(zid);
- if (ZEND_NUM_ARGS() < 2) {
+ if (option_is_null) {
char *s_code;
/* libcurl expects long datatype. So far no cases are known where
it would be an issue. Using zend_long would truncate a 64-bit