boringssl/crypto/bytestring
Adam Langley a33915d690 Have |CBB_init| zero the |CBB| before any possible failures.
People expect to do:

CBB foo;

if (!CBB_init(&foo, 100) ||
    …
    …) {
  CBB_cleanup(&foo);
  return 0;
}

However, currently, if the allocation of |initial_capacity| fails in
|CBB_init| then |CBB_cleanup| will operate on uninitialised values. This
change makes the above pattern safe.

Change-Id: I3e002fda8f0a3ac18650b504e7e84a842d4165ca
Reviewed-on: https://boringssl-review.googlesource.com/6495
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-11-16 21:59:46 +00:00
..
ber.c Correct the spelling of "primitive". 2015-11-03 21:47:19 +00:00
bytestring_test.cc Have |CBB_init| zero the |CBB| before any possible failures. 2015-11-16 21:59:46 +00:00
cbb.c Have |CBB_init| zero the |CBB| before any possible failures. 2015-11-16 21:59:46 +00:00
cbs.c Allow out_present to be NULL in CBS_get_optional_asn1 2015-09-03 18:46:17 +00:00
CMakeLists.txt Add a run_tests target to run all tests. 2015-10-26 20:33:44 +00:00
internal.h Export |CBS_get_any_ber_asn1_element|. 2015-06-05 21:56:42 +00:00