Skip to content

missing null check in ssh_channel_is_closed

in this function channel->session->alive is checked, but there's no check that channel->session is not NULL (ssh_session is a pointer to a struct).

{
    if (channel == NULL) {
        return SSH_ERROR;
    }
    return (channel->state != SSH_CHANNEL_STATE_OPEN || channel->session->alive == 0);
}

I suggest adding a check before accessing the member to prevent segmentation faults in cases where ssh_free() was called on the ssh_session used to init the ssh_channel before the ssh_channel was closed

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information