diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include "includes.h" | 39 | #include "includes.h" |
40 | RCSID("$OpenBSD: packet.c,v 1.115 2004/06/21 17:36:31 avsm Exp $"); | 40 | RCSID("$OpenBSD: packet.c,v 1.116 2004/10/20 11:48:53 markus Exp $"); |
41 | 41 | ||
42 | #include "openbsd-compat/sys-queue.h" | 42 | #include "openbsd-compat/sys-queue.h" |
43 | 43 | ||
@@ -995,6 +995,8 @@ packet_read_poll1(void) | |||
995 | buffer_len(&compression_buffer)); | 995 | buffer_len(&compression_buffer)); |
996 | } | 996 | } |
997 | type = buffer_get_char(&incoming_packet); | 997 | type = buffer_get_char(&incoming_packet); |
998 | if (type < SSH_MSG_MIN || type > SSH_MSG_MAX) | ||
999 | packet_disconnect("Invalid ssh1 packet type: %d", type); | ||
998 | return type; | 1000 | return type; |
999 | } | 1001 | } |
1000 | 1002 | ||
@@ -1107,6 +1109,8 @@ packet_read_poll2(u_int32_t *seqnr_p) | |||
1107 | * return length of payload (without type field) | 1109 | * return length of payload (without type field) |
1108 | */ | 1110 | */ |
1109 | type = buffer_get_char(&incoming_packet); | 1111 | type = buffer_get_char(&incoming_packet); |
1112 | if (type < SSH2_MSG_MIN || type >= SSH2_MSG_LOCAL_MIN) | ||
1113 | packet_disconnect("Invalid ssh2 packet type: %d", type); | ||
1110 | if (type == SSH2_MSG_NEWKEYS) | 1114 | if (type == SSH2_MSG_NEWKEYS) |
1111 | set_newkeys(MODE_IN); | 1115 | set_newkeys(MODE_IN); |
1112 | #ifdef PACKET_DEBUG | 1116 | #ifdef PACKET_DEBUG |