Make ssh_socket_set_fd() return errors

and properly check the return value where it is used

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-08-11 16:28:15 +02:00
parent 35d337834b
commit d00f267bc6
5 changed files with 31 additions and 19 deletions

View File

@@ -505,7 +505,10 @@ int ssh_bind_accept_fd(ssh_bind sshbind, ssh_session session, socket_t fd)
ssh_set_error_oom(sshbind);
return SSH_ERROR;
}
ssh_socket_set_fd(session->socket, fd);
rc = ssh_socket_set_fd(session->socket, fd);
if (rc != SSH_OK) {
return rc;
}
handle = ssh_socket_get_poll_handle(session->socket);
if (handle == NULL) {
ssh_set_error_oom(sshbind);