CID 1442835: Integer Overflow

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/8318)
This commit is contained in:
Pauli 2019-02-24 21:26:39 +10:00
parent 909f2e5983
commit 71d1b229e9

View File

@ -301,7 +301,7 @@ static OSSL_PROPERTY_LIST *stack_to_property_list(STACK_OF(PROPERTY_DEFINITION)
int i;
r = OPENSSL_malloc(sizeof(*r)
+ (n == 0 ? 0 : n - 1) * sizeof(r->properties[0]));
+ (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
if (r != NULL) {
sk_PROPERTY_DEFINITION_sort(sk);