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 | ||
@@ -981,6 +981,8 @@ packet_read_poll1(void) | |||
981 | buffer_len(&compression_buffer)); | 981 | buffer_len(&compression_buffer)); |
982 | } | 982 | } |
983 | type = buffer_get_char(&incoming_packet); | 983 | type = buffer_get_char(&incoming_packet); |
984 | if (type < SSH_MSG_MIN || type > SSH_MSG_MAX) | ||
985 | packet_disconnect("Invalid ssh1 packet type: %d", type); | ||
984 | return type; | 986 | return type; |
985 | } | 987 | } |
986 | 988 | ||
@@ -1093,6 +1095,8 @@ packet_read_poll2(u_int32_t *seqnr_p) | |||
1093 | * return length of payload (without type field) | 1095 | * return length of payload (without type field) |
1094 | */ | 1096 | */ |
1095 | type = buffer_get_char(&incoming_packet); | 1097 | type = buffer_get_char(&incoming_packet); |
1098 | if (type < SSH2_MSG_MIN || type >= SSH2_MSG_LOCAL_MIN) | ||
1099 | packet_disconnect("Invalid ssh2 packet type: %d", type); | ||
1096 | if (type == SSH2_MSG_NEWKEYS) | 1100 | if (type == SSH2_MSG_NEWKEYS) |
1097 | set_newkeys(MODE_IN); | 1101 | set_newkeys(MODE_IN); |
1098 | #ifdef PACKET_DEBUG | 1102 | #ifdef PACKET_DEBUG |