mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
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. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18647)
This commit is contained in:
parent
28adea9597
commit
1cb35ce06a
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user