1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

packet: Check return value of ssh_buffer_unpack().

CID: 1230357

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
This commit is contained in:
Andreas Schneider
2014-08-15 10:25:38 +02:00
parent 19433dca00
commit 662217f409

View File

@@ -462,12 +462,21 @@ int ssh_packet_send_unimplemented(ssh_session session, uint32_t seqnum){
*/
SSH_PACKET_CALLBACK(ssh_packet_unimplemented){
uint32_t seq;
int rc;
(void)session; /* unused */
(void)type;
(void)user;
ssh_buffer_unpack(packet, "d", &seq);
rc = ssh_buffer_unpack(packet, "d", &seq);
if (rc != SSH_OK) {
SSH_LOG(SSH_LOG_WARNING,
"Could not unpack SSH_MSG_UNIMPLEMENTED packet");
}
SSH_LOG(SSH_LOG_RARE,
"Received SSH_MSG_UNIMPLEMENTED (sequence number %d)",seq);
return SSH_PACKET_USED;
}