summaryrefslogtreecommitdiff
path: root/lib/libssl/bs_ber.c
diff options
context:
space:
mode:
authorDoug Hogan <doug@cvs.openbsd.org>2015-06-21 16:10:46 +0000
committerDoug Hogan <doug@cvs.openbsd.org>2015-06-21 16:10:46 +0000
commit5f8a32bc6edd93c2f6c223eeae0346d7a665f422 (patch)
tree771105474a3cbb55810639d948f36c2c2306d106 /lib/libssl/bs_ber.c
parentc472317cb406f8c4c0e5c78daa5fd840bca6d305 (diff)
Check for failure with CBB_init() in bs_ber.c.
From BoringSSL commit 3fa65f0f05f67615d9daf48940e07f84d094ac6e.
Diffstat (limited to 'lib/libssl/bs_ber.c')
-rw-r--r--lib/libssl/bs_ber.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libssl/bs_ber.c b/lib/libssl/bs_ber.c
index 3a391fe853f..6e945a02466 100644
--- a/lib/libssl/bs_ber.c
+++ b/lib/libssl/bs_ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs_ber.c,v 1.7 2015/06/17 07:20:39 doug Exp $ */
+/* $OpenBSD: bs_ber.c,v 1.8 2015/06/21 16:10:45 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
@@ -257,7 +257,8 @@ CBS_asn1_indefinite_to_definite(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_indefinite(in, &cbb, 0, 0, 0)) {
CBB_cleanup(&cbb);
return 0;