From 5f8a32bc6edd93c2f6c223eeae0346d7a665f422 Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Sun, 21 Jun 2015 16:10:46 +0000 Subject: Check for failure with CBB_init() in bs_ber.c. From BoringSSL commit 3fa65f0f05f67615d9daf48940e07f84d094ac6e. --- lib/libssl/bs_ber.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libssl/bs_ber.c') 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; -- cgit v1.2.3