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

Valgrind Report for ext/phar/tests/phar_setsignaturealgo2.phpt ('Phar::setSupportedSignatures() with hash')

Script

1: <?php
2: $fname 
dirname(__FILE__) . '/' basename(__FILE__'.php') . '.phar';
3:
$p = new Phar($fname);
4:
$p['file1.txt'] = 'hi';
5:
var_dump($p->getSignature());
6:
$p->setSignatureAlgorithm(Phar::MD5);
7:
var_dump($p->getSignature());
8:
$p->setSignatureAlgorithm(Phar::SHA1);
9:
var_dump($p->getSignature());
10: try {
11:
$p->setSignatureAlgorithm(Phar::SHA256);
12:
var_dump($p->getSignature());
13: } catch (
Exception $e) {
14: echo 
$e->getMessage();
15: }
16: try {
17:
$p->setSignatureAlgorithm(Phar::SHA512);
18:
var_dump($p->getSignature());
19: } catch (
Exception $e) {
20: echo 
$e->getMessage();
21: }
22: try {
23:
$config dirname(__FILE__) . '/files/openssl.cnf';
24:
$config_arg = array('config' => $config);
25:
$private openssl_get_privatekey(file_get_contents(dirname(__FILE__) . '/files/private.pem'));
26:
$pkey '';
27:
openssl_pkey_export($private$pkeyNULL$config_arg);
28:
$p->setSignatureAlgorithm(Phar::OPENSSL$pkey);
29:
var_dump($p->getSignature());
30: } catch (
Exception $e) {
31: echo 
$e->getMessage();
32: }
33:
?>
34:
===DONE===
35:

Report

==21748== Use of uninitialised value of size 8
==21748==    at 0x9BA4C8: phar_hex_str (util.c:1640)
==21748==    by 0x9BBF1C: phar_create_signature (util.c:2225)
==21748==    by 0x9F52BE: phar_flush (phar.c:3165)
==21748==    by 0xA07241: zim_Phar_setSignatureAlgorithm (phar_object.c:3105)
==21748==    by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==21748==    by 0xE72228: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:676)
==21748==    by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==21748==    by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==21748==    by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==21748==    by 0xD3043F: php_execute_script (main.c:2479)
==21748==    by 0xFF1374: do_cli (php_cli.c:993)
==21748==    by 0xFF2B21: main (php_cli.c:1377)
==21748== 
==21748== Use of uninitialised value of size 8
==21748==    at 0x9BA4FD: phar_hex_str (util.c:1641)
==21748==    by 0x9BBF1C: phar_create_signature (util.c:2225)
==21748==    by 0x9F52BE: phar_flush (phar.c:3165)
==21748==    by 0xA07241: zim_Phar_setSignatureAlgorithm (phar_object.c:3105)
==21748==    by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==21748==    by 0xE72228: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:676)
==21748==    by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==21748==    by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==21748==    by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==21748==    by 0xD3043F: php_execute_script (main.c:2479)
==21748==    by 0xFF1374: do_cli (php_cli.c:993)
==21748==    by 0xFF2B21: main (php_cli.c:1377)
==21748== 
==21748== Syscall param write(buf) points to uninitialised byte(s)
==21748==    at 0xD1D6650: __write_nocancel (in /lib64/libc-2.12.so)
==21748==    by 0xD658BA: php_stdiop_write (plain_wrapper.c:325)
==21748==    by 0xD5A9DF: _php_stream_write_buffer (streams.c:1129)
==21748==    by 0xD5AF1F: _php_stream_write (streams.c:1240)
==21748==    by 0x9F5437: phar_flush (phar.c:3181)
==21748==    by 0xA07241: zim_Phar_setSignatureAlgorithm (phar_object.c:3105)
==21748==    by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==21748==    by 0xE72228: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:676)
==21748==    by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==21748==    by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==21748==    by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==21748==    by 0xD3043F: php_execute_script (main.c:2479)
==21748==  Address 0x1538f8f0 is 0 bytes inside a block of size 129 alloc'd
==21748==    at 0x4C2794E: malloc (vg_replace_malloc.c:270)
==21748==    by 0xDB8224: _emalloc (zend_alloc.c:2427)
==21748==    by 0x9BB979: phar_create_signature (util.c:2145)
==21748==    by 0x9F52BE: phar_flush (phar.c:3165)
==21748==    by 0xA07241: zim_Phar_setSignatureAlgorithm (phar_object.c:3105)
==21748==    by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==21748==    by 0xE72228: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:676)
==21748==    by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==21748==    by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==21748==    by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==21748==    by 0xD3043F: php_execute_script (main.c:2479)
==21748==    by 0xFF1374: do_cli (php_cli.c:993)
==21748== 

 

Generated at Wed, 15 May 2013 22:03:26 +0000 (3 days ago)

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