|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63660 php_ssh2_fopen_wrapper_parse_path segfaults
Submitted: 2012-11-30 17:22 UTC Modified: 2012-12-01 15:36 UTC
From: Assigned: remi (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.3.19 OS: Debian Linux
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:
New email:
PHP Version: OS:


 [2012-11-30 17:22 UTC]
The following line lead to a segmenation fault just because I missed the
"/" separator between the resource handler and the $filename variable:

        if (file_exists("ssh2.sftp://{$this->sftp}$filename")) { ... }

The backtrace from the core file starts with:

(gdb) bt
#0  0x00007f53a5643558 in ?? () from /lib/
#1  0x00007f53a2bfd2ce in php_ssh2_fopen_wraper_parse_path (path=0x2764268 "ssh2.sftp://Resource id #659unittest-20121127.txt.gz", 
    type=<value optimized out>, context=0x0, psession=<value optimized out>, presource_id=0x7fff76be3eec, psftp=0x7fff76be3ed8, 
    psftp_rsrcid=0x7fff76be3ee8) at /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:226
#2  0x00007f53a2bffc96 in php_ssh2_sftp_urlstat (wrapper=<value optimized out>, url=0x2764268 "ssh2.sftp://Resource id #659unittest-20121127.txt.gz", 
    flags=2, ssb=0x7fff76be3fe0, context=0x4) at /tmp/pear/temp/ssh2/ssh2_sftp.c:390

Expected result:
Error message about invalid resource.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-01 15:34 UTC]
Automatic comment from SVN on behalf of remi
Log: Fixed Bug #63660 php_ssh2_fopen_wrapper_parse_path segfaults
 [2012-12-01 15:36 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2012-12-01 15:36 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: remi
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 01:01:24 2023 UTC