From 71d1b229e9bc230afaea64f03833329f82f6e488 Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 24 Feb 2019 21:26:39 +1000 Subject: [PATCH] CID 1442835: Integer Overflow Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/8318) --- crypto/property/property_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c index 2094d38e88..074da51c6b 100644 --- a/crypto/property/property_parse.c +++ b/crypto/property/property_parse.c @@ -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); -- 2.25.1