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>
This commit is contained in:
David Benjamin 2014-07-25 04:27:53 -04:00 committed by Adam Langley
parent 61b66ffcc2
commit 9a37359008

View File

@ -255,6 +255,11 @@ static int tls1_check_duplicate_extensions(const CBS *cbs)
num_extensions++;
}
if (num_extensions == 0)
{
return 1;
}
extension_types = (uint16_t*)OPENSSL_malloc(sizeof(uint16_t) * num_extensions);
if (extension_types == NULL)
{