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

==14995== Use of uninitialised value of size 8
==14995==    at 0x91B6DD: phar_hex_str (util.c:1649)
==14995==    by 0x91D0CA: phar_create_signature (util.c:2234)
==14995==    by 0x954311: phar_flush (phar.c:3171)
==14995==    by 0x965693: zim_Phar_setSignatureAlgorithm (phar_object.c:3136)
==14995==    by 0xDB8BD2: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==14995==    by 0xDB94BF: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:428)
==14995==    by 0xDB7C17: execute (zend_vm_execute.h:107)
==14995==    by 0xD6B0B7: zend_execute_scripts (zend.c:1259)
==14995==    by 0xCB7000: php_execute_script (main.c:2316)
==14995==    by 0xEAE410: main (php_cli.c:1189)
==14995== 
==14995== Use of uninitialised value of size 8
==14995==    at 0x91B70C: phar_hex_str (util.c:1650)
==14995==    by 0x91D0CA: phar_create_signature (util.c:2234)
==14995==    by 0x954311: phar_flush (phar.c:3171)
==14995==    by 0x965693: zim_Phar_setSignatureAlgorithm (phar_object.c:3136)
==14995==    by 0xDB8BD2: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==14995==    by 0xDB94BF: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:428)
==14995==    by 0xDB7C17: execute (zend_vm_execute.h:107)
==14995==    by 0xD6B0B7: zend_execute_scripts (zend.c:1259)
==14995==    by 0xCB7000: php_execute_script (main.c:2316)
==14995==    by 0xEAE410: main (php_cli.c:1189)
==14995== 
==14995== Syscall param write(buf) points to uninitialised byte(s)
==14995==    at 0xCCC4650: __write_nocancel (in /lib64/libc-2.12.so)
==14995==    by 0xCEB90D: php_stdiop_write (plain_wrapper.c:320)
==14995==    by 0xCE07E5: _php_stream_write_buffer (streams.c:1063)
==14995==    by 0xCE0D25: _php_stream_write (streams.c:1174)
==14995==    by 0x954488: phar_flush (phar.c:3187)
==14995==    by 0x965693: zim_Phar_setSignatureAlgorithm (phar_object.c:3136)
==14995==    by 0xDB8BD2: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==14995==    by 0xDB94BF: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:428)
==14995==    by 0xDB7C17: execute (zend_vm_execute.h:107)
==14995==    by 0xD6B0B7: zend_execute_scripts (zend.c:1259)
==14995==    by 0xCB7000: php_execute_script (main.c:2316)
==14995==    by 0xEAE410: main (php_cli.c:1189)
==14995==  Address 0x14da0840 is 0 bytes inside a block of size 129 alloc'd
==14995==    at 0x4C2794E: malloc (vg_replace_malloc.c:270)
==14995==    by 0xD32860: _emalloc (zend_alloc.c:2348)
==14995==    by 0x91CB2D: phar_create_signature (util.c:2154)
==14995==    by 0x954311: phar_flush (phar.c:3171)
==14995==    by 0x965693: zim_Phar_setSignatureAlgorithm (phar_object.c:3136)
==14995==    by 0xDB8BD2: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==14995==    by 0xDB94BF: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:428)
==14995==    by 0xDB7C17: execute (zend_vm_execute.h:107)
==14995==    by 0xD6B0B7: zend_execute_scripts (zend.c:1259)
==14995==    by 0xCB7000: php_execute_script (main.c:2316)
==14995==    by 0xEAE410: main (php_cli.c:1189)
==14995== 

 

Generated at Sun, 19 May 2013 20:27:25 +0000 (3 days ago)

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