Skip to content

Commit 608e339

Browse files
committed
add test
1 parent 45a91c4 commit 608e339

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Zend/zend_API.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ static zend_always_inline void zend_call_known_fcc(
844844
{
845845
zend_function *func = fcc->function_handler;
846846
if (UNEXPECTED(!func)) {
847+
ZVAL_UNDEF(retval_ptr);
847848
return;
848849
}
849850
/* Need to copy trampolines as they get released after they are called */

ext/curl/tests/gh16359.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-16360 - curl_setopt with CURLOPT_WRITEFUNCTION and no user fn
3+
--EXTENSIONS--
4+
curl
5+
--FILE--
6+
<?php
7+
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-CURLOPT_WRITEFUNCTION-trampoline');
8+
$fp = fopen($log_file, 'w+');
9+
fwrite($fp, "test");
10+
$ch = curl_init();
11+
curl_setopt($ch, CURLOPT_WRITEFUNCTION, null);
12+
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
13+
curl_exec($ch);
14+
echo "DONE";
15+
?>
16+
--EXPECT--
17+
DONE

0 commit comments

Comments
 (0)