|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79757 Segmentation fault error when using file_get_contents() function with ssh2.sftp
Submitted: 2020-06-29 13:15 UTC Modified: 2021-01-14 12:59 UTC
From: janis dot mozgis at printful dot com Assigned: cmb (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 7.4.7 OS: Ubuntu 18 / Opensuse
Private report: No CVE-ID: None
 [2020-06-29 13:15 UTC] janis dot mozgis at printful dot com
We are getting "segmentation fault" error when trying to use file_get_contents() + stream context with ssh2.sftp wrapper. 
It works with ssh2_connect() + ssh2_sftp() functions, but not with creating the stream context.

PHP: v7.4
ssh2 package: v1.2
Tested with Ubuntu and opensuse OSes, same result.

Test script:
$options = [
    "ssh2" => [
        "username" => "user",
        "pubkey_file" => 'path/to/',
        "privkey_file" => 'path/to/key'
$context = stream_context_create($options, []);
file_get_contents('ssh2.s', false, $context);

Expected result:
File content

Actual result:
segmentation fault error


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-13 09:56 UTC]
The following pull request has been associated:

Patch Name: Bug #79757 segfault when passing NULL to zend_list_delete
On GitHub:
 [2021-01-14 12:59 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 03 10:01:28 2023 UTC