diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c0ee6c73e..78c720d7a 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -15732,7 +15732,7 @@ int EncodePolicyOID(byte *out, word32 *outSz, const char *in, void* heap) oid[i++] = (byte) (((tb++) ? 0x80 : 0) | x); } - if ((idx+(word32)i) > *outSz) { + if ((idx+(word32)i) >= *outSz) { XFREE(str, heap, DYNAMIC_TYPE_TMP_BUFFER); return BUFFER_E; }