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

Valgrind Report for ext/soap/tests/custom_content_type.phpt ('SOAP customized Content-Type, eg. SwA use case')

Script

1: <?php
2:
3:
include __DIR__ "/../../../sapi/cli/tests/php_cli_server.inc";
4:
5:
$args substr(PHP_OS03) == 'WIN' "-d extension_dir=" ini_get("extension_dir") . " -d extension=php_soap.dll" "";
6:
$code = <<<'PHP'
7:
/* Receive */
8: $content = trim(file_get_contents("php://input")) . PHP_EOL;
9:
PHP;
10:
11:
php_cli_server_start($codefalse$args);
12:
13:
$client = new soapclient(NULL, [
14:   
'location' => 'http://' PHP_CLI_SERVER_ADDRESS,
15:   
'uri' => 'misc-uri',
16:   
'soap_version' => SOAP_1_2,
17:   
'user_agent' => 'Vincent JARDIN, test headers',
18:   
'trace' => true/* record the headers before sending */
19:   
'stream_context' => stream_context_create([
20:     
'http' => [
21:       
'header' => sprintf("MIME-Version: 1.0\r\n"),
22:       
'content_type' => sprintf("Multipart/Related")
23:     ],
24:   ]),
25: ]);
26:
27:
$client->__soapCall("foo", [ 'arg1' => "XXXbar"]);
28:
29:
$headers $client->__getLastRequestHeaders();
30:
31: if (
strpos($headers'Multipart/Related; action="misc-uri#foo"') === FALSE)
32:   
printf("Content-Type NOK %s" PHP_EOL$headers);
33: else
34:   
printf("Content-Type OK" PHP_EOL);
35:
36:
/*
37:  * In case of an empty content-type, let's fallback to the default content.
38:  */
39:
$client2 = new soapclient(NULL, [
40:   
'location' => 'http://' PHP_CLI_SERVER_ADDRESS,
41:   
'uri' => 'misc-uri',
42:   
'soap_version' => SOAP_1_2,
43:   
'user_agent' => 'Vincent JARDIN, test headers',
44:   
'trace' => true/* record the headers before sending */
45:   
'stream_context' => stream_context_create([
46:     
'http' => [
47:       
'header' => sprintf("MIME-Version: 1.0\r\n"),
48:       
'content_type' => sprintf("")
49:     ],
50:   ]),
51: ]);
52:
53:
$client2->__soapCall("foo", [ 'arg1' => "XXXbar"]);
54:
55:
$headers $client2->__getLastRequestHeaders();
56:
57: if (
strpos($headers'Content-Type: application/soap+xml; charset=utf-8; action="misc-uri#foo"') === FALSE)
58:   
printf("Content-Type Default NOK %s" PHP_EOL$headers);
59: else
60:   
printf("Content-Type Default OK" PHP_EOL);
61:
?>
62:
==DONE==
63:

Report

==20642== Jump to the invalid address stated on the next line
==20642==    at 0x4FE: ???
==20642==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==20642==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==20642==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==20642==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==20642==    by 0x400E5E8: _dl_catch_error (in /lib64/ld-2.12.so)
==20642==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==20642==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==20642==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==20642==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==20642==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==20642==    by 0x5: ???
==20642==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==20642== 
==20642== 
==20642== Process terminating with default action of signal 11 (SIGSEGV)
==20642==  Bad permissions for mapped region at address 0x4FE
==20642==    at 0x4FE: ???
==20642==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==20642==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==20642==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==20642==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==20642==    by 0x400E5E8: _dl_catch_error (in /lib64/ld-2.12.so)
==20642==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==20642==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==20642==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==20642==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==20642==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==20642==    by 0x5: ???

 

Generated at Thu, 17 Oct 2019 23:21:35 +0000 (2 days ago)

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