Add error checking to ssh_message_auth_reply_success().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@444 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-09 14:24:49 +00:00
parent e5b7e8fdfc
commit 38d8875021

View File

@@ -298,11 +298,20 @@ error:
return rc; return rc;
} }
int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial){ int ssh_message_auth_reply_success(SSH_MESSAGE *msg, int partial) {
if(partial) if (msg == NULL) {
return ssh_message_auth_reply_default(msg,partial); return SSH_ERROR;
buffer_add_u8(msg->session->out_buffer,SSH2_MSG_USERAUTH_SUCCESS); }
return packet_send(msg->session);
if (partial) {
return ssh_message_auth_reply_default(msg, partial);
}
if (buffer_add_u8(msg->session->out_buffer,SSH2_MSG_USERAUTH_SUCCESS) < 0) {
return SSH_ERROR;
}
return packet_send(msg->session);
} }
static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){ static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){