php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24098 pathinfo crashes
Submitted: 2003-06-09 10:57 UTC Modified: 2003-06-09 13:12 UTC
From: spotter at mail dot ee Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5CVS-2003-06-09 (dev) OS: Suse 8.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: spotter at mail dot ee
New email:
PHP Version: OS:

 

 [2003-06-09 10:57 UTC] spotter at mail dot ee
Function pathinfo() crashes on simple call. 
For example <? pathinfo("/dsds.asa") ?> gives segfault.

Following little fix wont crash anymore:

# diff ext/standard/string.c.old ext/standard/string.c
1271d1270
<               int ret_len;


And a backtrace:
Starting program: /root/php5/sapi/cli/php /data/docroot/test.php

Program received signal SIGSEGV, Segmentation fault.
0x4016fb74 in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0x4016fb74 in memcpy () from /lib/libc.so.6
#1  0x40014020 in __libc_missing_32bit_uids () from /lib/ld-linux.so.2
#2  0x081594ce in add_assoc_stringl_ex (arg=0x8228a24, key=0x818672e "extension", key_len=10, str=0x8228a81 "asa", length=136541059,
    duplicate=1) at /root/php5old/Zend/zend_API.c:763
#3  0x080f09c4 in zif_pathinfo (ht=1, return_value=0x8228a04, this_ptr=0x0, return_value_used=1) at /root/php5old/ext/standard/string.c:1283
#4  0x0816c2f0 in zend_do_fcall_common_helper (execute_data=0xbfffc580, op_array=0x82331fc) at /root/php5old/Zend/zend_execute.c:2596
#5  0x0816c83f in zend_do_fcall_handler (execute_data=0xbfffc580, op_array=0x82331fc) at /root/php5old/Zend/zend_execute.c:2724
#6  0x08168594 in execute (op_array=0x82331fc) at /root/php5old/Zend/zend_execute.c:1244
#7  0x08157c2a in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php5old/Zend/zend.c:1017
#8  0x08124ad9 in php_execute_script (primary_file=0xbfffe980) at /root/php5old/main/main.c:1678
#9  0x08172caa in main (argc=2, argv=0xbfffea14) at /root/php5old/sapi/cli/php_cli.c:909
#10 0x401078ae in __libc_start_main () from /lib/libc.so.6

test.php is:
<?
        print_r(pathinfo("/dsds.asa"));
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-09 13:12 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC