diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-09-15 16:34:02 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-09-19 08:12:48 +0000 |
commit | b072aff8565d64c9b9c6970996cc6ddd5f844bb4 (patch) | |
tree | 4561ff898acaa052b035542f2b279b4eb6293e30 /lib | |
parent | c070a9e03b25a1faf72cc9e42282d98431ba8ebf (diff) | |
download | gnutls-b072aff8565d64c9b9c6970996cc6ddd5f844bb4.tar.gz |
parse_handshake_header: allow 1-byte sized fragments
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/buffers.c | 5 |
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 |