limit malloc'ed data in eax_decrypt_verify_memory()

This commit is contained in:
Steffen Jaeckel 2017-08-03 15:00:37 +02:00
parent 05f7393067
commit 9f020b17df

View File

@ -55,6 +55,9 @@ int eax_decrypt_verify_memory(int cipher,
/* default to zero */ /* default to zero */
*stat = 0; *stat = 0;
/* limit taglen */
taglen = MIN(taglen, MAXBLOCKSIZE);
/* allocate ram */ /* allocate ram */
buf = XMALLOC(taglen); buf = XMALLOC(taglen);
eax = XMALLOC(sizeof(*eax)); eax = XMALLOC(sizeof(*eax));