packet: Reformat ssh_packet_parse_type()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
родитель
07986731c6
Коммит
76f5a60a82
@ -515,13 +515,15 @@ SSH_PACKET_CALLBACK(ssh_packet_unimplemented){
|
|||||||
/** @internal
|
/** @internal
|
||||||
* @parse the "Type" header field of a packet and updates the session
|
* @parse the "Type" header field of a packet and updates the session
|
||||||
*/
|
*/
|
||||||
int ssh_packet_parse_type(ssh_session session) {
|
int ssh_packet_parse_type(ssh_session session)
|
||||||
|
{
|
||||||
memset(&session->in_packet, 0, sizeof(PACKET));
|
memset(&session->in_packet, 0, sizeof(PACKET));
|
||||||
if(session->in_buffer == NULL) {
|
|
||||||
|
if (session->in_buffer == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ssh_buffer_get_u8(session->in_buffer, &session->in_packet.type) == 0) {
|
if (ssh_buffer_get_u8(session->in_buffer, &session->in_packet.type) == 0) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Packet too short to read type");
|
ssh_set_error(session, SSH_FATAL, "Packet too short to read type");
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user