diff options
| author | tb <> | 2023-04-23 11:34:57 +0000 |
|---|---|---|
| committer | tb <> | 2023-04-23 11:34:57 +0000 |
| commit | ff36f25f7ccd3f6edb9f06c26f12c96a19847c09 (patch) | |
| tree | 64d414ee603dccfc4150bcd8c8aced95c80194d2 /src | |
| parent | 0d736aa8eb426f9e1fb0c6e8fa09cb32effd7f7f (diff) | |
| download | openbsd-ff36f25f7ccd3f6edb9f06c26f12c96a19847c09.tar.gz openbsd-ff36f25f7ccd3f6edb9f06c26f12c96a19847c09.tar.bz2 openbsd-ff36f25f7ccd3f6edb9f06c26f12c96a19847c09.zip | |
Add missing NULL check for BN_new()
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_utl.c | 7 |
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; |
