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:
committed by
Norbert Pocs
parent
c01377081f
commit
6a965e0981
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user