summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-23 11:34:57 +0000
committertb <>2023-04-23 11:34:57 +0000
commite52d8630bbe21af8a646605f68c47c4cf2cde369 (patch)
tree64d414ee603dccfc4150bcd8c8aced95c80194d2 /src/lib
parentf3a2b886ebe1e530c1d009a7c4d88eed8510a550 (diff)
downloadopenbsd-e52d8630bbe21af8a646605f68c47c4cf2cde369.tar.gz
openbsd-e52d8630bbe21af8a646605f68c47c4cf2cde369.tar.bz2
openbsd-e52d8630bbe21af8a646605f68c47c4cf2cde369.zip
Add missing NULL check for BN_new()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_utl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c
index f7b9c8586d..51c3135bbe 100644
--- a/src/lib/libcrypto/x509/x509_utl.c
+++ b/src/lib/libcrypto/x509/x509_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_utl.c,v 1.11 2023/04/23 11:25:21 tb Exp $ */ 1/* $OpenBSD: x509_utl.c,v 1.12 2023/04/23 11:34:57 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -248,7 +248,10 @@ s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value)
248 X509V3error(X509V3_R_INVALID_NULL_VALUE); 248 X509V3error(X509V3_R_INVALID_NULL_VALUE);
249 return NULL; 249 return NULL;
250 } 250 }
251 bn = BN_new(); 251 if ((bn = BN_new()) == NULL) {
252 X509V3error(ERR_R_MALLOC_FAILURE);
253 return NULL;
254 }
252 if (value[0] == '-') { 255 if (value[0] == '-') {
253 value++; 256 value++;
254 isneg = 1; 257 isneg = 1;