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) {