php.net |  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: ch@php.net Assigned: remi (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.3.19 OS: Debian Linux
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: ch@php.net
New email:
PHP Version: OS:

 

 [2012-11-30 17:22 UTC] ch@php.net
Description:
------------
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/libc.so.6
#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:
--------------
Segfault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-01 15:34 UTC] remi@php.net
Automatic comment from SVN on behalf of remi
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328592
Log: Fixed Bug #63660 php_ssh2_fopen_wrapper_parse_path segfaults
 [2012-12-01 15:36 UTC] remi@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-12-01 15:36 UTC] remi@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: remi
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC