fuzz/asn1.c: Add check for ASN1_item_i2d
As the potential failure of the ASN1_item_i2d,
it should be better to check the return value.
@@ -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);
+ if (ASN1_item_i2d(o, &der, i) > 0) {
OPENSSL_free(der);
+ }
ASN1_item_free(o, i);
}
}
