mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
fuzz: Do not expect the channel open and request succeed
Thanks oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45109 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -152,7 +152,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
}
|
||||
|
||||
channel = ssh_channel_new(session);
|
||||
assert(channel != NULL);
|
||||
if (channel == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = ssh_channel_open_session(channel);
|
||||
if (rc != SSH_OK) {
|
||||
@ -160,7 +162,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
}
|
||||
|
||||
rc = ssh_channel_request_exec(channel, "ls");
|
||||
assert(rc == SSH_OK);
|
||||
if (rc != SSH_OK) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
select_loop(session, channel);
|
||||
|
||||
|
Reference in New Issue
Block a user