Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-05-16 02:11:57 +0300
committerAdam Langley <agl@google.com>2015-05-21 21:00:10 +0300
commit3fa65f0f05f67615d9daf48940e07f84d094ac6e (patch)
tree9c4c6b56547b20c13098624e4442f1fad6941ffd /crypto/bytestring
parent0b635c52b241af78b69addecbb84c7d55f3cabb4 (diff)
Fix some malloc test crashs.
This isn't exhaustive. There are still failures in some tests which probably ought to get C++'d first. Change-Id: Iac58df9d98cdfd94603d54374a531b2559df64c3 Reviewed-on: https://boringssl-review.googlesource.com/4795 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bytestring')
-rw-r--r--crypto/bytestring/ber.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/bytestring/ber.c b/crypto/bytestring/ber.c
index 2729fa13..2a7df630 100644
--- a/crypto/bytestring/ber.c
+++ b/crypto/bytestring/ber.c
@@ -209,7 +209,9 @@ int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len) {
return 1;
}
- CBB_init(&cbb, CBS_len(in));
+ if (!CBB_init(&cbb, CBS_len(in))) {
+ return 0;
+ }
if (!cbs_convert_ber(in, &cbb, 0, 0, 0)) {
CBB_cleanup(&cbb);
return 0;