Files
archived-pecl-networking-ssh2/tests/bug79631.phpt
Christoph M. Becker 9fb1cf84f0 Fix #79631: SSH disconnect segfault with SFTP (assertion failed)
If the SSH2 Session resource has already been closed, the libssh2
session has been as well, and the `LIBSSH2_SESSION*` has been set NULL.
If that is the case, we must not call `libssh2_sftp_shutdown()`.
2021-02-09 14:48:43 +01:00

21 lines
362 B
PHP

--TEST--
Bug 79631 (SSH disconnect segfault with SFTP (assertion failed))
--SKIPIF--
<?php
require('ssh2_skip.inc');
ssh2t_needs_auth();
ssh2t_writes_remote();
?>
--FILE--
<?php
require('ssh2_test.inc');
$ssh = ssh2_connect(TEST_SSH2_HOSTNAME, TEST_SSH2_PORT);
ssh2t_auth($ssh);
$sftp = ssh2_sftp($ssh);
ssh2_disconnect($ssh);
echo "done\n";
?>
--EXPECT--
done