diff options
| author | miod <> | 2016-11-05 15:21:20 +0000 |
|---|---|---|
| committer | miod <> | 2016-11-05 15:21:20 +0000 |
| commit | 19bc742a20d4c505bc890d49e01c44192e9dbeff (patch) | |
| tree | 3ff1170fcf21ad73d4b0495b47f156e6cd3e93b1 | |
| parent | f72470bc783a016dc0f537ddde0f7868dcf634f4 (diff) | |
| download | openbsd-19bc742a20d4c505bc890d49e01c44192e9dbeff.tar.gz openbsd-19bc742a20d4c505bc890d49e01c44192e9dbeff.tar.bz2 openbsd-19bc742a20d4c505bc890d49e01c44192e9dbeff.zip | |
Check BIO_new*() for failure.
ok beck@ jsing@
| -rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ht.c | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509v3/pcy_tree.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index 4d21543396..61af3717b7 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ocsp_ht.c,v 1.22 2014/10/03 06:02:38 doug Exp $ */ | 1 | /* $OpenBSD: ocsp_ht.c,v 1.23 2016/11/05 15:21:20 miod 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 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -157,7 +157,10 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) | |||
| 157 | if (rctx == NULL) | 157 | if (rctx == NULL) |
| 158 | return NULL; | 158 | return NULL; |
| 159 | rctx->state = OHS_ERROR; | 159 | rctx->state = OHS_ERROR; |
| 160 | rctx->mem = BIO_new(BIO_s_mem()); | 160 | if ((rctx->mem = BIO_new(BIO_s_mem())) == NULL) { |
| 161 | free(rctx); | ||
| 162 | return NULL; | ||
| 163 | } | ||
| 161 | rctx->io = io; | 164 | rctx->io = io; |
| 162 | rctx->asn1_len = 0; | 165 | rctx->asn1_len = 0; |
| 163 | if (maxline > 0) | 166 | if (maxline > 0) |
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c index 7b28acbe1f..a56c183bc9 100644 --- a/src/lib/libcrypto/x509v3/pcy_tree.c +++ b/src/lib/libcrypto/x509v3/pcy_tree.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pcy_tree.c,v 1.16 2016/03/11 07:08:45 mmcc Exp $ */ | 1 | /* $OpenBSD: pcy_tree.c,v 1.17 2016/11/05 15:21:20 miod 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 2004. | 3 | * project 2004. |
| 4 | */ | 4 | */ |
| @@ -99,7 +99,9 @@ tree_print(char *str, X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) | |||
| 99 | int i; | 99 | int i; |
| 100 | BIO *err; | 100 | BIO *err; |
| 101 | 101 | ||
| 102 | err = BIO_new_fp(stderr, BIO_NOCLOSE); | 102 | if ((err = BIO_new_fp(stderr, BIO_NOCLOSE)) == NULL) |
| 103 | return; | ||
| 104 | |||
| 103 | if (!curr) | 105 | if (!curr) |
| 104 | curr = tree->levels + tree->nlevel; | 106 | curr = tree->levels + tree->nlevel; |
| 105 | else | 107 | else |
