diff options
author | David Benjamin <davidben@chromium.org> | 2015-05-16 02:11:57 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-21 21:00:10 +0300 |
commit | 3fa65f0f05f67615d9daf48940e07f84d094ac6e (patch) | |
tree | 9c4c6b56547b20c13098624e4442f1fad6941ffd /crypto/modes | |
parent | 0b635c52b241af78b69addecbb84c7d55f3cabb4 (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/modes')
-rw-r--r-- | crypto/modes/gcm_test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/modes/gcm_test.c b/crypto/modes/gcm_test.c index 3548c81b..a8819ea4 100644 --- a/crypto/modes/gcm_test.c +++ b/crypto/modes/gcm_test.c @@ -347,6 +347,9 @@ static int run_test_case(unsigned test_num, const struct test_case *test) { } out = OPENSSL_malloc(plaintext_len); + if (out == NULL) { + goto out; + } if (AES_set_encrypt_key(key, key_len*8, &aes_key)) { fprintf(stderr, "%u: AES_set_encrypt_key failed.\n", test_num); goto out; |