mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests: Add missing check for valid fd
CID 1032753 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -80,6 +80,7 @@ static void torture_channel_read_error(void **state) {
|
|||||||
ssh_session session = s->ssh.session;
|
ssh_session session = s->ssh.session;
|
||||||
ssh_channel channel;
|
ssh_channel channel;
|
||||||
int rc;
|
int rc;
|
||||||
|
int fd;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
channel = ssh_channel_new(session);
|
channel = ssh_channel_new(session);
|
||||||
@@ -92,7 +93,9 @@ static void torture_channel_read_error(void **state) {
|
|||||||
assert_ssh_return_code(session, rc);
|
assert_ssh_return_code(session, rc);
|
||||||
|
|
||||||
/* send crap and for server to send us a disconnect */
|
/* send crap and for server to send us a disconnect */
|
||||||
rc = write(ssh_get_fd(session),"AAAA", 4);
|
fd = ssh_get_fd(session);
|
||||||
|
assert_true(fd > 2);
|
||||||
|
rc = write(fd, "AAAA", 4);
|
||||||
assert_int_equal(rc, 4);
|
assert_int_equal(rc, 4);
|
||||||
|
|
||||||
for (i=0;i<20;++i){
|
for (i=0;i<20;++i){
|
||||||
|
|||||||
Reference in New Issue
Block a user