php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29678 opendir() with ftp:// wrapper segfaults if path doesnt have trailing slash
Submitted: 2004-08-14 15:29 UTC Modified: 2004-08-16 03:41 UTC
From: bjori at jeshus dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.0.0 OS: FreeBSD 5.2.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bjori at jeshus dot com
New email:
PHP Version: OS:

 

 [2004-08-14 15:29 UTC] bjori at jeshus dot com
Description:
------------
When trying to use opendir() with ftp:// wrapper ( without trailing slash ) php segmentation faults. Would have expected an error message from opendir().


Sounds like http://bugs.php.net/bug.php?id=386 which is fixed..?

Reproduce code:
---------------
<?php
$url = 'ftp://anonymous:anonymous@ftp.no.freebsd.org';
$dir = opendir ( $url );
var_dump ( $dir );
?>


Expected result:
----------------
opendir() should return error.

Actual result:
--------------
PHP crashes.

#0  0x080ebafa in _php_stream_write ()
#1  0x080c6891 in php_stream_ftp_opendir ()
#2  0x080ecefe in _php_stream_opendir ()
#3  0x08086b87 in _php_do_opendir ()
#4  0x08086c5e in zif_opendir ()
#5  0x0813a19c in zend_do_fcall_common_helper ()
#6  0x0813a7b6 in zend_do_fcall_handler ()
#7  0x0813687f in execute ()
#8  0x081170c9 in zend_execute_scripts ()
#9  0x080dc7b6 in php_execute_script ()
#10 0x081429db in main ()
#11 0x08062fb2 in _start ()


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-14 18:03 UTC] bjori at jeshus dot com
wrong username/password gives also the same error even with trailing slash i.e.
$url = 'ftp://foo:bar@ftp.no.freebsd.org/';
$dir = opendir ( $url );
var_dump ( $dir );

- Hannes
 [2004-08-16 03:41 UTC] iliaa@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC