php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73410 ssh2_exec segmentation fault
Submitted: 2016-10-28 10:00 UTC Modified: 2017-03-02 20:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: ilia dot gorchakov at gmail dot com Assigned: langemeijer (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 7.0.12 OS: Ubuntu 16.04
Private report: No CVE-ID: None
 [2016-10-28 10:00 UTC] ilia dot gorchakov at gmail dot com
Description:
------------
I tried it with:
1) libssh2-1.5.0 - libssh2-1.8.0 
2) pecl-networking-ssh2-master (ver 1.0)

Test script:
---------------
<?php

$host = '***HOST***';
$port = '***PORT***';
$username = '***USERNAME***';
$password = '***PASS***';



$conn_id = ssh2_connect($host, $port);
if (!ssh2_auth_password($conn_id, $username, $password)) {
    echo "Invalid auth\n";
    exit;
}
echo "auth OK\n";

$stream = ssh2_exec($conn_id, "uname -a" . PHP_EOL);
if (!is_resource($stream)) {
    echo 'Invalid command'."\n";
    exit;
}
echo "exec OK\n";
stream_set_blocking($stream, true);
$response = stream_get_contents($stream);
echo "response OK\n";

Expected result:
----------------
auth OK
exec OK
response OK

Actual result:
--------------
auth OK
exec OK
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-14 06:07 UTC] krakjoe@php.net
-Assigned To: +Assigned To: seander
 [2017-02-06 07:16 UTC] mhagstrand at gmail dot com
This bug is fixed by the PR I put in for bug https://bugs.php.net/bug.php?id=73819

https://github.com/php/pecl-networking-ssh2/pull/24
 [2017-02-06 19:45 UTC] langemeijer@php.net
PR #24 is merged into master.

Could you try current master and see if the problem is solved?
 [2017-02-06 19:58 UTC] langemeijer@php.net
-Assigned To: seander +Assigned To: langemeijer
 [2017-02-11 22:05 UTC] mhagstrand at gmail dot com
This bug is fixed in master. I added a test that confirms it now working:

https://github.com/php/pecl-networking-ssh2/pull/26
 [2017-03-02 20:19 UTC] langemeijer@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jul 07 23:01:29 2020 UTC