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

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

Script

1: <?php
2: $fname 
dirname(__FILE__) . '/' basename(__FILE__'.php') . '.phar.tar';
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(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

==2538== Use of uninitialised value of size 8
==2538==    at 0x9BBB0A: phar_hex_str (util.c:1648)
==2538==    by 0x9BD55E: phar_create_signature (util.c:2233)
==2538==    by 0x9C4755: phar_tar_flush (tar.c:1171)
==2538==    by 0x9F36B0: phar_flush (phar.c:2605)
==2538==    by 0xA08D2D: zim_Phar_setSignatureAlgorithm (phar_object.c:3117)
==2538==    by 0xE7289D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:547)
==2538==    by 0xE73D5A: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:680)
==2538==    by 0xE70468: execute_ex (zend_vm_execute.h:356)
==2538==    by 0xE70FFA: zend_execute (zend_vm_execute.h:381)
==2538==    by 0xE0E4F2: zend_execute_scripts (zend.c:1316)
==2538==    by 0xD31EFF: php_execute_script (main.c:2479)
==2538==    by 0xFF2EA4: do_cli (php_cli.c:993)
==2538== 
==2538== Use of uninitialised value of size 8
==2538==    at 0x9BBB3F: phar_hex_str (util.c:1649)
==2538==    by 0x9BD55E: phar_create_signature (util.c:2233)
==2538==    by 0x9C4755: phar_tar_flush (tar.c:1171)
==2538==    by 0x9F36B0: phar_flush (phar.c:2605)
==2538==    by 0xA08D2D: zim_Phar_setSignatureAlgorithm (phar_object.c:3117)
==2538==    by 0xE7289D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:547)
==2538==    by 0xE73D5A: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:680)
==2538==    by 0xE70468: execute_ex (zend_vm_execute.h:356)
==2538==    by 0xE70FFA: zend_execute (zend_vm_execute.h:381)
==2538==    by 0xE0E4F2: zend_execute_scripts (zend.c:1316)
==2538==    by 0xD31EFF: php_execute_script (main.c:2479)
==2538==    by 0xFF2EA4: do_cli (php_cli.c:993)
==2538== 
==2538== Syscall param write(buf) points to uninitialised byte(s)
==2538==    at 0xD1D6650: __write_nocancel (in /lib64/libc-2.12.so)
==2538==    by 0xD6737A: php_stdiop_write (plain_wrapper.c:325)
==2538==    by 0xD5C49F: _php_stream_write_buffer (streams.c:1129)
==2538==    by 0xD5C9DF: _php_stream_write (streams.c:1240)
==2538==    by 0x9C4994: phar_tar_flush (tar.c:1205)
==2538==    by 0x9F36B0: phar_flush (phar.c:2605)
==2538==    by 0xA08D2D: zim_Phar_setSignatureAlgorithm (phar_object.c:3117)
==2538==    by 0xE7289D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:547)
==2538==    by 0xE73D5A: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:680)
==2538==    by 0xE70468: execute_ex (zend_vm_execute.h:356)
==2538==    by 0xE70FFA: zend_execute (zend_vm_execute.h:381)
==2538==    by 0xE0E4F2: zend_execute_scripts (zend.c:1316)
==2538==  Address 0x15393fd0 is 0 bytes inside a block of size 129 alloc'd
==2538==    at 0x4C2794E: malloc (vg_replace_malloc.c:270)
==2538==    by 0xDB9CE4: _emalloc (zend_alloc.c:2427)
==2538==    by 0x9BCFBB: phar_create_signature (util.c:2153)
==2538==    by 0x9C4755: phar_tar_flush (tar.c:1171)
==2538==    by 0x9F36B0: phar_flush (phar.c:2605)
==2538==    by 0xA08D2D: zim_Phar_setSignatureAlgorithm (phar_object.c:3117)
==2538==    by 0xE7289D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:547)
==2538==    by 0xE73D5A: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:680)
==2538==    by 0xE70468: execute_ex (zend_vm_execute.h:356)
==2538==    by 0xE70FFA: zend_execute (zend_vm_execute.h:381)
==2538==    by 0xE0E4F2: zend_execute_scripts (zend.c:1316)
==2538==    by 0xD31EFF: php_execute_script (main.c:2479)
==2538== 

 

Generated at Fri, 17 May 2013 23:23:52 +0000 (3 days ago)

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