aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio
diff options
context:
space:
mode:
authorBob Beck <bbe@google.com>2023-02-07 19:06:08 -0700
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-13 22:13:11 +0000
commitdcabfe2d8940529a69e007660fa7bf6c15954ecc (patch)
tree4cc7c4784b38ea9f7c25a322d342a5e24e8137b7 /crypto/bio
parentd5e93f521b3fd4f57049583a1584d285e5aab16c (diff)
downloadboringssl-dcabfe2d8940529a69e007660fa7bf6c15954ecc.zip
boringssl-dcabfe2d8940529a69e007660fa7bf6c15954ecc.tar.gz
boringssl-dcabfe2d8940529a69e007660fa7bf6c15954ecc.tar.bz2
Make OPENSSL_malloc push ERR_R_MALLOC_FAILURE on failure.
Remove all the other ERR_R_MALLOC_FAILURES from the codebase. Also changes cbb to push to the error stack, to correctly report cbb failures instead of now only reporting malloc failures. Previously it turned all cbb failures into a malloc failure Bug: 564 Change-Id: Ic13208bf9d9aaa470e83b2f15782fc94946bbc7b Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/57046 Auto-Submit: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio.c2
-rw-r--r--crypto/bio/pair.c2
-rw-r--r--crypto/bio/printf.c1
3 files changed, 0 insertions, 5 deletions
diff --git a/crypto/bio/bio.c b/crypto/bio/bio.c
index 453e45a..610c733 100644
--- a/crypto/bio/bio.c
+++ b/crypto/bio/bio.c
@@ -72,7 +72,6 @@
BIO *BIO_new(const BIO_METHOD *method) {
BIO *ret = OPENSSL_malloc(sizeof(BIO));
if (ret == NULL) {
- OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -609,7 +608,6 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) {
*out = OPENSSL_malloc(len);
if (*out == NULL) {
- OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
return 0;
}
OPENSSL_memcpy(*out, header, header_len);
diff --git a/crypto/bio/pair.c b/crypto/bio/pair.c
index 8f47568..c4d09c1 100644
--- a/crypto/bio/pair.c
+++ b/crypto/bio/pair.c
@@ -317,7 +317,6 @@ static int bio_make_pair(BIO *bio1, BIO *bio2, size_t writebuf1_len,
}
b1->buf = OPENSSL_malloc(b1->size);
if (b1->buf == NULL) {
- OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
return 0;
}
b1->len = 0;
@@ -330,7 +329,6 @@ static int bio_make_pair(BIO *bio1, BIO *bio2, size_t writebuf1_len,
}
b2->buf = OPENSSL_malloc(b2->size);
if (b2->buf == NULL) {
- OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
return 0;
}
b2->len = 0;
diff --git a/crypto/bio/printf.c b/crypto/bio/printf.c
index 253546b..102256b 100644
--- a/crypto/bio/printf.c
+++ b/crypto/bio/printf.c
@@ -83,7 +83,6 @@ int BIO_printf(BIO *bio, const char *format, ...) {
out = OPENSSL_malloc(requested_len + 1);
out_malloced = 1;
if (out == NULL) {
- OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
return -1;
}
va_start(args, format);