summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-09-15 16:34:02 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-09-16 18:22:45 +0200
commit34c560c3d62cdeb6cbd8e71c5dd621a8491fb9d2 (patch)
tree848beaced1b01fcc64a504c34d9d9046295cdfec
parent1fb934803ecb38816bf9603148d790dc2ca4d74d (diff)
downloadgnutls-34c560c3d62cdeb6cbd8e71c5dd621a8491fb9d2.tar.gz
parse_handshake_header: allow 1-byte sized fragments
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/buffers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/buffers.c b/lib/buffers.c
index 8b85c6398d..69c4966faf 100644
--- a/lib/buffers.c
+++ b/lib/buffers.c
@@ -955,12 +955,13 @@ parse_handshake_header(gnutls_session_t session, mbuffer_st * bufel,
return
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
- if (hsk->length > 0 && (hsk->start_offset >= hsk->end_offset ||
+ if (hsk->length > 0 && (hsk->start_offset > hsk->end_offset ||
hsk->end_offset - hsk->start_offset >=
data_size
- || hsk->end_offset >= hsk->length))
+ || hsk->end_offset >= hsk->length)) {
return
gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
+ }
else if (hsk->length == 0 && hsk->end_offset != 0
&& hsk->start_offset != 0)
return