Bug #66960 [NEW]: phar long filename crash
From: twratajczak at gmail dot com
Operating system:
PHP version: Irrelevant
Package: PHAR related
Bug Type: Bug
Bug description:phar long filename crash
Description:
------------
performing file operations through phar:// with filenames over
MAXPATHLEN causes crash
*** stack smashing detected ***: php terminated
Test script:
---------------
<?php
$p = new Phar('/tmp/a.phar');
file_exists('phar:///tmp/a.phar/'. str_repeat("a", 4100));
// only for this test case phar.readonly=Off is required
Expected result:
----------------
file_exists returning false
Actual result:
--------------
Program terminated with signal 6, Aborted.
#0 0x00007f5960d9cf77 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or
directory.
(gdb) bt
#0 0x00007f5960d9cf77 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007f5960da05e8 in __GI_abort () at abort.c:90
#2 0x00007f5960dda4fb in __libc_message (do_abort=do_abort@entry=1,
fmt=fmt@entry=0x7f5960eebf10 "*** %s ***: %s terminated\n") at
../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3 0x00007f5960e7808c in __GI___fortify_fail (msg=<optimized out>,
msg@entry=0x7f5960eebef8 "stack smashing detected") at
fortify_fail.c:37
#4 0x00007f5960e78030 in __stack_chk_fail () at stack_chk_fail.c:28
#5 0x00000000004c048f in phar_set_inode (entry=0x7fff95d1c6d0) at
/home/tratajczak/Downloads/php-master-201403261230/ext/phar/phar_internal.h:542
#6 0x6161616161616161 in ?? ()
...
--
Edit bug report at https://bugs.php.net/bug.php?id=66960&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66960&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66960&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66960&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66960&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66960&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66960&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66960&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66960&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66960&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66960&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66960&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66960&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66960&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66960&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66960&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66960&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66960&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66960&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66960&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66960&r=mysqlcfg
Thread (4 messages)
- twratajczak at gmail dot com