diff options
Diffstat (limited to 'fuzz/asn1.c')
-rw-r--r-- | fuzz/asn1.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fuzz/asn1.c b/fuzz/asn1.c index 69978cd054..ee602a08a3 100644 --- a/fuzz/asn1.c +++ b/fuzz/asn1.c @@ -317,8 +317,9 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) ASN1_item_print(bio, o, 4, i, pctx); BIO_free(bio); } - ASN1_item_i2d(o, &der, i); - OPENSSL_free(der); + if (ASN1_item_i2d(o, &der, i) > 0) { + OPENSSL_free(der); + } ASN1_item_free(o, i); } } |