summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/handshake.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/handshake.c b/src/handshake.c
index 2359af4..06adef8 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -128,8 +128,10 @@ void fastd_handshake_handle(fastd_context *ctx, fastd_peer *peer, fastd_buffer b
if (ptr+4+len > (uint8_t*)buffer.data + buffer.len)
break;
- handshake.records[type].length = len;
- handshake.records[type].data = ptr+4;
+ if (type < RECORD_MAX) {
+ handshake.records[type].length = len;
+ handshake.records[type].data = ptr+4;
+ }
ptr += 4+len;
}