summaryrefslogtreecommitdiff
path: root/ext/curl/tests/bug68937_2.phpt
blob: 4b09b438c5ec9b13f0b4e075a699305dadb92127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--TEST--
Bug # #68937 (Segfault in curl_multi_exec)
--SKIPIF--
<?php
include 'skipif.inc';
if (getenv('SKIP_ASAN')) die('skip some curl versions leak on longjmp');
?>
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();

$url = "{$host}/get.inc";

$ch = curl_init($url);
curl_setopt_array($ch, array(
    CURLOPT_HEADER => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_INFILESIZE => filesize(__FILE__),
    CURLOPT_INFILE => fopen(__FILE__, 'r'),
    CURLOPT_HTTPHEADER => array(
        'Expect:',
        'Content-Length: 1',
    ),
    CURLOPT_READFUNCTION => 'curl_read',
    CURLOPT_CONNECTTIMEOUT => 1,
    CURLOPT_TIMEOUT => 1
));

function curl_read($ch, $fp, $len) {
    var_dump($fp);
    exit;
}

curl_exec($ch);
curl_close($ch);
?>
--EXPECTF--
resource(%d) of type (stream)