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:
23
src/packet.c
23
src/packet.c
@@ -461,14 +461,23 @@ int ssh_packet_send_unimplemented(ssh_session session, uint32_t seqnum){
|
|||||||
* @brief handles a SSH_MSG_UNIMPLEMENTED packet
|
* @brief handles a SSH_MSG_UNIMPLEMENTED packet
|
||||||
*/
|
*/
|
||||||
SSH_PACKET_CALLBACK(ssh_packet_unimplemented){
|
SSH_PACKET_CALLBACK(ssh_packet_unimplemented){
|
||||||
uint32_t seq;
|
uint32_t seq;
|
||||||
|
int rc;
|
||||||
|
|
||||||
(void)session; /* unused */
|
(void)session; /* unused */
|
||||||
(void)type;
|
(void)type;
|
||||||
(void)user;
|
(void)user;
|
||||||
ssh_buffer_unpack(packet, "d", &seq);
|
|
||||||
SSH_LOG(SSH_LOG_RARE,
|
rc = ssh_buffer_unpack(packet, "d", &seq);
|
||||||
"Received SSH_MSG_UNIMPLEMENTED (sequence number %d)",seq);
|
if (rc != SSH_OK) {
|
||||||
return SSH_PACKET_USED;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal
|
/** @internal
|
||||||
|
|||||||
Reference in New Issue
Block a user