[openssl] openssl-3.0 update
matthias.st.pierre at ncp-e.com
matthias.st.pierre at ncp-e.com
Sun Feb 20 12:06:30 UTC 2022
The branch openssl-3.0 has been updated
via d1ce1b5df602e4fc64bd27b65b4b1343229007af (commit)
from 18e046c8a2e562cf947aa2b5b4cce31bb0ff75a1 (commit)
- Log -----------------------------------------------------------------
commit d1ce1b5df602e4fc64bd27b65b4b1343229007af
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date: Sat Feb 12 19:27:09 2022 +0800
fuzz/asn1.c: Add missing check for BIO_new
Since the BIO_new may fail, the 'bio' could be NULL pointer and be used.
Therefore, it should be better to check it and skip the print if fails.
Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17690)
(cherry picked from commit d43597c718dd6e4f2b18d5cec1eb791503a18988)
-----------------------------------------------------------------------
Summary of changes:
fuzz/asn1.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/fuzz/asn1.c b/fuzz/asn1.c
index 8ce9a57c25..1db219c358 100644
--- a/fuzz/asn1.c
+++ b/fuzz/asn1.c
@@ -218,8 +218,10 @@ static ASN1_PCTX *pctx;
int len2; \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type); \
+ BIO_free(bio); \
+ } \
len2 = I2D(type, &der); \
if (len2 != 0) {} \
OPENSSL_free(der); \
@@ -235,8 +237,10 @@ static ASN1_PCTX *pctx;
if (type != NULL) { \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type, 0); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type, 0); \
+ BIO_free(bio); \
+ } \
I2D(type, &der); \
OPENSSL_free(der); \
TYPE ## _free(type); \
@@ -251,8 +255,10 @@ static ASN1_PCTX *pctx;
if (type != NULL) { \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type, 0, pctx); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type, 0, pctx); \
+ BIO_free(bio); \
+ } \
I2D(type, &der); \
OPENSSL_free(der); \
TYPE ## _free(type); \
@@ -307,9 +313,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
if (o != NULL) {
BIO *bio = BIO_new(BIO_s_null());
-
- ASN1_item_print(bio, o, 4, i, pctx);
- BIO_free(bio);
+ if (bio != NULL) {
+ ASN1_item_print(bio, o, 4, i, pctx);
+ BIO_free(bio);
+ }
ASN1_item_i2d(o, &der, i);
OPENSSL_free(der);
ASN1_item_free(o, i);
More information about the openssl-commits
mailing list