From d1018e4ca5097cf7dde4caf2a909ca462b327bfe Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 11 Feb 2017 09:12:02 +0800 Subject: [PATCH] Ignore empty payload --- src/aead.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aead.c b/src/aead.c index eff13b21..baf2ce3e 100644 --- a/src/aead.c +++ b/src/aead.c @@ -586,6 +586,9 @@ aead_chunk_decrypt(cipher_ctx_t *ctx, uint8_t *p, uint8_t *c, uint8_t *n, mlen = ntohs(*(uint16_t *)len_buf); mlen = mlen & CHUNK_SIZE_MASK; + if (mlen == 0) + return CRYPTO_ERROR; + size_t chunk_len = 2 * tlen + CHUNK_SIZE_LEN + mlen; if (*clen < chunk_len)