diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 2e5cb96e9..e3ab7e545 100755 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -685,7 +685,8 @@ static int SetShortInt(byte* input, word32* inOutIdx, word32 number, input[idx++] = ar[i]; len++; } - /* set number of bytes for integer and update index value */ + /* jump back to beginning of input buffer using unaltered inOutIdx value + * and set number of bytes for integer, then update the index value */ input[*inOutIdx + 1] = (byte)len; *inOutIdx = idx;