summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-05-03 15:13:13 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-05-03 16:16:04 +0200
commit4fada510fabc703d0ae697a77732335a8da6e6fd (patch)
treedffddf83e05aec34986a5645c33e959d87ea94ec
parent33dadb924d96a1b1f63ee8cb1bb1d746d7986f29 (diff)
downloadgnutls-4fada510fabc703d0ae697a77732335a8da6e6fd.tar.gz
encrypt_packet_tls13: made size check safer
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/cipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cipher.c b/lib/cipher.c
index 205940ffbc..a2215bc1ee 100644
--- a/lib/cipher.c
+++ b/lib/cipher.c
@@ -459,7 +459,7 @@ encrypt_packet_tls13(gnutls_session_t session,
/* check whether padding would exceed max */
if (fdata_size > max) {
- if (unlikely(max-plain->size-1 < 0))
+ if (unlikely(max < (ssize_t)plain->size+1))
return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
min_pad = max - plain->size - 1;