1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

Error out if ctx is NULL.

Signed-off-by: Kevin Backhouse <kevinbackhouse@github.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Kevin Backhouse
2023-06-02 17:24:29 +01:00
committed by Norbert Pocs
parent c01377081f
commit 6a965e0981

View File

@@ -654,8 +654,12 @@ int ssh_handle_packets(ssh_session session, int timeout)
ssh_poll_add_events(spoll, POLLIN); ssh_poll_add_events(spoll, POLLIN);
ctx = ssh_poll_get_ctx(spoll); ctx = ssh_poll_get_ctx(spoll);
if (!ctx) { if (ctx == NULL) {
ctx = ssh_poll_get_default_ctx(session); ctx = ssh_poll_get_default_ctx(session);
if (ctx == NULL) {
ssh_set_error_oom(session);
return SSH_ERROR;
}
ssh_poll_ctx_add(ctx, spoll); ssh_poll_ctx_add(ctx, spoll);
} }