From ed6fbf91746e4c807e36f3b09a24f04298ec6b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Thu, 18 Jun 2020 09:26:09 +0200 Subject: Fix UNKNOWN default values in ext/curl Closes GH-5734 --- ext/curl/interface.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ext/curl/interface.c') 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 -- cgit v1.2.1