From: xkernel Date: Mon, 20 Jun 2022 09:46:39 +0000 (+0800) Subject: v3_sxnet: add a check for the return of i2s_ASN1_INTEGER() X-Git-Tag: openssl-3.2.0-alpha1~2442 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ef1f848a646565d4dd86e56542cf921d4921ad9;p=thirdparty%2Fopenssl.git v3_sxnet: add a check for the return of i2s_ASN1_INTEGER() Reviewed-by: Matt Caswell Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/18608) --- diff --git a/crypto/x509/v3_sxnet.c b/crypto/x509/v3_sxnet.c index a4331968206..5ac3bab3549 100644 --- a/crypto/x509/v3_sxnet.c +++ b/crypto/x509/v3_sxnet.c @@ -78,6 +78,8 @@ static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { id = sk_SXNETID_value(sx->ids, i); tmp = i2s_ASN1_INTEGER(NULL, id->zone); + if (tmp == NULL) + return 0; BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); OPENSSL_free(tmp); ASN1_STRING_print(out, id->user);