#29678 [Opn]: opendir() with ftp:// wrapper segfaults if path doesnt have trailing slash

From: Date: Sat, 14 Aug 2004 16:03:43 +0000
Subject: #29678 [Opn]: opendir() with ftp:// wrapper segfaults if path doesnt have trailing slash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64612@lists.php.net to get a copy of this message
ID: 29678 User updated by: bjori at jeshus dot com Reported By: bjori at jeshus dot com Status: Open Bug Type: Reproducible crash Operating System: FreeBSD 5.2.1 PHP Version: 5.0.0 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2004-08-14 15:29:44] 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 () ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29678&edit=1

« previous php.bugs (#64612) next »