PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/curl/tests/curl_copy_handle_basic_002.phpt ('Test curl_copy_handle() with simple POST')

Script

1: <?php
2:   
include 'server.inc';
3:   
$host curl_cli_server_start();
4:
5:   echo 
'*** Testing curl copy handle with simple POST ***' "\n";
6:
7:   
$url "{$host}/get.php?test=getpost";
8:   
$ch curl_init();
9:
10:   
ob_start(); // start output buffering
11:   
curl_setopt($chCURLOPT_RETURNTRANSFER1);
12:   
curl_setopt($chCURLOPT_POST1);
13:   
curl_setopt($chCURLOPT_POSTFIELDS"Hello=World&Foo=Bar&Person=John%20Doe");
14:   
curl_setopt($chCURLOPT_URL$url); //set the url we want to use
15:   
16:   
$copy curl_copy_handle($ch);
17:   
curl_close($ch);
18:  
19:   
$curl_content curl_exec($copy);
20:   
curl_close($copy);
21:
22:   
var_dump$curl_content );
23:
?>
24:
===DONE===
25:

Report

==19739== Invalid read of size 1
==19739==    at 0x4C29914: __GI_strlen (vg_replace_strmem.c:413)
==19739==    by 0xA67BE85: strdup (in /lib64/libc-2.12.so)
==19739==    by 0x7E641C6: ??? (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E694F1: Curl_dupset (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E738B9: curl_easy_duphandle (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x6F8980: zif_curl_copy_handle (interface.c:1922)
==19739==    by 0x100C7AD: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:576)
==19739==    by 0x100A6EE: execute_ex (zend_vm_execute.h:406)
==19739==    by 0x100B207: zend_execute (zend_vm_execute.h:447)
==19739==    by 0xF42687: zend_execute_scripts (zend.c:1389)
==19739==    by 0xE3AAB7: php_execute_script (main.c:2475)
==19739==    by 0x113DAE2: do_cli (php_cli.c:967)
==19739==  Address 0x11d6e785 is 0 bytes after a block of size 37 alloc'd
==19739==    at 0x4C2824A: malloc (vg_replace_malloc.c:296)
==19739==    by 0x7E6699D: Curl_setopt (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E73C21: curl_easy_setopt (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x6FC40E: _php_curl_setopt (interface.c:2593)
==19739==    by 0x6FD360: zif_curl_setopt (interface.c:2777)
==19739==    by 0x100C7AD: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:576)
==19739==    by 0x100A6EE: execute_ex (zend_vm_execute.h:406)
==19739==    by 0x100B207: zend_execute (zend_vm_execute.h:447)
==19739==    by 0xF42687: zend_execute_scripts (zend.c:1389)
==19739==    by 0xE3AAB7: php_execute_script (main.c:2475)
==19739==    by 0x113DAE2: do_cli (php_cli.c:967)
==19739==    by 0x113F551: main (php_cli.c:1334)
==19739== 
==19739== Invalid read of size 2
==19739==    at 0x4C2AB60: memcpy (vg_replace_strmem.c:916)
==19739==    by 0x7E641C6: ??? (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E694F1: Curl_dupset (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E738B9: curl_easy_duphandle (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x6F8980: zif_curl_copy_handle (interface.c:1922)
==19739==    by 0x100C7AD: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:576)
==19739==    by 0x100A6EE: execute_ex (zend_vm_execute.h:406)
==19739==    by 0x100B207: zend_execute (zend_vm_execute.h:447)
==19739==    by 0xF42687: zend_execute_scripts (zend.c:1389)
==19739==    by 0xE3AAB7: php_execute_script (main.c:2475)
==19739==    by 0x113DAE2: do_cli (php_cli.c:967)
==19739==    by 0x113F551: main (php_cli.c:1334)
==19739==  Address 0x11d6e784 is 36 bytes inside a block of size 37 alloc'd
==19739==    at 0x4C2824A: malloc (vg_replace_malloc.c:296)
==19739==    by 0x7E6699D: Curl_setopt (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x7E73C21: curl_easy_setopt (in /usr/lib64/libcurl.so.4.1.1)
==19739==    by 0x6FC40E: _php_curl_setopt (interface.c:2593)
==19739==    by 0x6FD360: zif_curl_setopt (interface.c:2777)
==19739==    by 0x100C7AD: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:576)
==19739==    by 0x100A6EE: execute_ex (zend_vm_execute.h:406)
==19739==    by 0x100B207: zend_execute (zend_vm_execute.h:447)
==19739==    by 0xF42687: zend_execute_scripts (zend.c:1389)
==19739==    by 0xE3AAB7: php_execute_script (main.c:2475)
==19739==    by 0x113DAE2: do_cli (php_cli.c:967)
==19739==    by 0x113F551: main (php_cli.c:1334)
==19739== 

 

Generated at Sun, 05 Jul 2015 15:45:03 +0000 (9 hours ago)

Copyright © 2005-2015 The PHP Group
All rights reserved.