PHP  
 PHP_5_4
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

==29769== Use of uninitialised value of size 8
==29769==    at 0x955574: phar_hex_str (util.c:1640)
==29769==    by 0x956F61: phar_create_signature (util.c:2225)
==29769==    by 0x95DE2B: phar_tar_flush (tar.c:1159)
==29769==    by 0x98BB32: phar_flush (phar.c:2605)
==29769==    by 0x9A065E: zim_Phar_setSignatureAlgorithm (phar_object.c:3127)
==29769==    by 0xDD4B8E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==29769==    by 0xDD5F25: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:754)
==29769==    by 0xDD2CD8: execute (zend_vm_execute.h:410)
==29769==    by 0xD77966: zend_execute_scripts (zend.c:1315)
==29769==    by 0xCA9FB5: php_execute_script (main.c:2492)
==29769==    by 0xF45593: do_cli (php_cli.c:988)
==29769==    by 0xF46BD0: main (php_cli.c:1364)
==29769== 
==29769== Use of uninitialised value of size 8
==29769==    at 0x9555A3: phar_hex_str (util.c:1641)
==29769==    by 0x956F61: phar_create_signature (util.c:2225)
==29769==    by 0x95DE2B: phar_tar_flush (tar.c:1159)
==29769==    by 0x98BB32: phar_flush (phar.c:2605)
==29769==    by 0x9A065E: zim_Phar_setSignatureAlgorithm (phar_object.c:3127)
==29769==    by 0xDD4B8E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==29769==    by 0xDD5F25: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:754)
==29769==    by 0xDD2CD8: execute (zend_vm_execute.h:410)
==29769==    by 0xD77966: zend_execute_scripts (zend.c:1315)
==29769==    by 0xCA9FB5: php_execute_script (main.c:2492)
==29769==    by 0xF45593: do_cli (php_cli.c:988)
==29769==    by 0xF46BD0: main (php_cli.c:1364)
==29769== 
==29769== Syscall param write(buf) points to uninitialised byte(s)
==29769==    at 0xCFCA650: __write_nocancel (in /lib64/libc-2.12.so)
==29769==    by 0xCDE44D: php_stdiop_write (plain_wrapper.c:325)
==29769==    by 0xCD326E: _php_stream_write_buffer (streams.c:1134)
==29769==    by 0xCD37AE: _php_stream_write (streams.c:1245)
==29769==    by 0x95E00B: phar_tar_flush (tar.c:1190)
==29769==    by 0x98BB32: phar_flush (phar.c:2605)
==29769==    by 0x9A065E: zim_Phar_setSignatureAlgorithm (phar_object.c:3127)
==29769==    by 0xDD4B8E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==29769==    by 0xDD5F25: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:754)
==29769==    by 0xDD2CD8: execute (zend_vm_execute.h:410)
==29769==    by 0xD77966: zend_execute_scripts (zend.c:1315)
==29769==    by 0xCA9FB5: php_execute_script (main.c:2492)
==29769==  Address 0x14dafa90 is 0 bytes inside a block of size 129 alloc'd
==29769==    at 0x4C2794E: malloc (vg_replace_malloc.c:270)
==29769==    by 0xD2A43D: _emalloc (zend_alloc.c:2423)
==29769==    by 0x9569C4: phar_create_signature (util.c:2145)
==29769==    by 0x95DE2B: phar_tar_flush (tar.c:1159)
==29769==    by 0x98BB32: phar_flush (phar.c:2605)
==29769==    by 0x9A065E: zim_Phar_setSignatureAlgorithm (phar_object.c:3127)
==29769==    by 0xDD4B8E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==29769==    by 0xDD5F25: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:754)
==29769==    by 0xDD2CD8: execute (zend_vm_execute.h:410)
==29769==    by 0xD77966: zend_execute_scripts (zend.c:1315)
==29769==    by 0xCA9FB5: php_execute_script (main.c:2492)
==29769==    by 0xF45593: do_cli (php_cli.c:988)
==29769== 

 

Generated at Mon, 13 May 2013 22:40:14 +0000 (6 days ago)

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