|  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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bjori at jeshus dot com
New email:
PHP Version: OS:


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

Sounds like which is fixed..?

Reproduce code:
$url = '';
$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 ()


Add a Patch

Pull Requests

Add a Pull Request


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 = '';
$dir = opendir ( $url );
var_dump ( $dir );

- Hannes
 [2004-08-16 03:41 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 19 16:01:26 2019 UTC