summaryrefslogtreecommitdiffstats
path: root/ssl/d1_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r--ssl/d1_both.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index b58fdc2f1d..99a031c0af 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -324,12 +324,18 @@ int dtls1_do_write(SSL *s, int type)
len = s->init_num;
}
+ if ( len < DTLS1_HM_HEADER_LENGTH )
+ {
+ /*
+ * len is so small that we really can't do anything sensible
+ * so fail
+ */
+ return -1;
+ }
dtls1_fix_message_header(s, frag_off,
len - DTLS1_HM_HEADER_LENGTH);
dtls1_write_message_header(s, (unsigned char *)&s->init_buf->data[s->init_off]);
-
- OPENSSL_assert(len >= DTLS1_HM_HEADER_LENGTH);
}
ret=dtls1_write_bytes(s,type,&s->init_buf->data[s->init_off],