From:             
Operating system: irrelevant
PHP version:      5.3.4
Package:          Zip Related
Bug Type:         Bug
Bug description:stream_get_contents failed

Description:
------------
Segmentation fault



backtrace:



(gdb) bt

#0  0x0000003510e79320 in strchr () from /lib64/libc.so.6

#1  0x000000000065a23c in php_zip_ops_stat (stream=<value optimized out>,
ssb=0x7fff6bb223e0) at /root/php-5.3.4/ext/zip/zip_stream.c:111

#2  0x00000000006c22c5 in _php_stream_copy_to_mem (src=0xd2d6038,
buf=0x7fff6bb224c8, maxlen=35, persistent=0) at
/root/php-5.3.4/main/streams/streams.c:1275

#3  0x000000000063019e in zif_stream_get_contents (ht=<value optimized
out>, return_value=0xd2d5f08, return_value_ptr=<value optimized out>,
this_ptr=<value optimized out>, return_value_used=<value optimized out>)

    at /root/php-5.3.4/ext/standard/streamsfuncs.c:443

#4  0x000000000064506c in suhosin_execute_internal
(execute_data_ptr=0x2ac667a0b050, return_value_used=1) at
/root/php-5.3.4/ext/suhosin/execute.c:1673

#5  0x0000000000746475 in zend_do_fcall_common_helper_SPEC
(execute_data=0x2ac667a0b050) at
/root/php-5.3.4/Zend/zend_vm_execute.h:318

#6  0x000000000071e15c in execute (op_array=0xd2d43c8) at
/root/php-5.3.4/Zend/zend_vm_execute.h:107

#7  0x00000000006455b9 in suhosin_execute_ex (op_array=0xd2d43c8, zo=0,
dummy=0) at /root/php-5.3.4/ext/suhosin/execute.c:585

#8  0x00000000006fb95d in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /root/php-5.3.4/Zend/zend.c:1194

#9  0x00000000006ab9cd in php_execute_script (primary_file=0x7fff6bb24d70)
at /root/php-5.3.4/main/main.c:2265

#10 0x00000000007803ac in main (argc=2, argv=0x7fff6bb24fe8) at
/root/php-5.3.4/sapi/cli/php_cli.c:1193

Test script:
---------------
<?php



$target_file = 'META-INF/MANIFEST.MF';



$za = new ZipArchive();

if ($za->open('test.jar') !== TRUE)

{

    return FALSE;

}



if ($za->statName($target_file) !== FALSE)

{

    $fd = $za->getStream($target_file);

}

else

{

    $fd = FALSE;

}

$za->close();



if (is_resource($fd))

{

    echo strlen(stream_get_contents($fd));

}



?>

Expected result:
----------------
273

Actual result:
--------------
Segmentation fault

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53579&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53579&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53579&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53579&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53579&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53579&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53579&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53579&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53579&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53579&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53579&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53579&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53579&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53579&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53579&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53579&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53579&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53579&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53579&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53579&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53579&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53579&r=mysqlcfg

Reply via email to