Bug #66960 [Fbk->Csd]: phar long filename crash
Edit report at https://bugs.php.net/bug.php?id=66960&edit=1
ID: 66960
Updated by: bishop@php.net
Reported by: twratajczak at gmail dot com
Summary: phar long filename crash
-Status: Feedback
+Status: Closed
Type: Bug
Package: PHAR related
PHP Version: Irrelevant
Assigned To: bishop
Block user comment: N
Private report: N
New Comment:
Glad it no longer recurs! I've added a test just to be sure it doesn't appear in future
versions.
Previous Comments:
------------------------------------------------------------------------
[2018-01-08 20:28:54] twratajczak at gmail dot com
I can verify that with PHP 7.1.11-0ubuntu0.17.10.1 this code works as expected. Thanks
------------------------------------------------------------------------
[2018-01-08 01:42:07] bishop@php.net
I am not seeing this behavior in the 7.1 series on Centos 7. Can you reproduce it in any current PHP
version (as of today, 7.1+)? If so, on what OS and architecture?
------------------------------------------------------------------------
[2014-03-26 14:20:37] twratajczak at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=66960&edit=1
Thread (4 messages)