commit | 9a37359008fb981b669a83553bfb8969cbc6019c | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@chromium.org> | Fri Jul 25 04:27:53 2014 -0400 |
committer | Adam Langley <agl@google.com> | Wed Jul 30 00:35:38 2014 +0000 |
tree | c6a47e261c3b5ae56288e7fb027cb4d359d311cc | |
parent | 61b66ffcc29f28900db4b037865a2206eb62242e [diff] [blame] |
Don't malloc(0) on empty extensions list. Caught by clang scan-build. Change-Id: I29092d659f1ac21c6a74b925f6abc0283e7652fc Reviewed-on: https://boringssl-review.googlesource.com/1344 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 4e79f74..6116f45 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c
@@ -255,6 +255,11 @@ num_extensions++; } + if (num_extensions == 0) + { + return 1; + } + extension_types = (uint16_t*)OPENSSL_malloc(sizeof(uint16_t) * num_extensions); if (extension_types == NULL) {