From 082e51d7780cef40f4ee896a8aede5fe6feaa6b5 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 4 May 2020 10:32:05 -0600 Subject: [PATCH] check on length of unwrap before memmove --- wolfcrypt/src/asn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 2c7facc55..b14356906 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -2683,6 +2683,9 @@ int ToTraditional_ex(byte* input, word32 sz, word32* algId) if (length < 0) return length; + if (length + inOutIdx > sz) + return BUFFER_E; + XMEMMOVE(input, input + inOutIdx, length); return length;