diff options
author | David Benjamin <davidben@chromium.org> | 2014-11-19 05:52:26 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-11-20 01:17:50 +0300 |
commit | ae3e487d51d3414769ed89b06683f3cbde5c7828 (patch) | |
tree | 38530bca72fb0491aff29e2cab3c057a03e88743 /ssl/test | |
parent | 69a01608f33ab6fe2c3485d94aef1fe9eacf5364 (diff) |
Fix a couple more malloc test crashes.
The ex_data index may fail to be allocated. Also don't leave a dangling pointer
in handshake_dgst if EVP_DigestInit_ex fails and check a few more init function
failures.
Change-Id: I2e99a89b2171c9d73ccc925a2f35651af34ac5fb
Reviewed-on: https://boringssl-review.googlesource.com/2342
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/test')
-rw-r--r-- | ssl/test/bssl_shim.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl/test/bssl_shim.cc b/ssl/test/bssl_shim.cc index 9f9fac37..4239ee3e 100644 --- a/ssl/test/bssl_shim.cc +++ b/ssl/test/bssl_shim.cc @@ -669,6 +669,9 @@ int main(int argc, char **argv) { return 1; } g_ex_data_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); + if (g_ex_data_index < 0) { + return 1; + } TestConfig config; if (!ParseConfig(argc - 1, argv + 1, &config)) { |