From f14f406340e4f5f1b1d674f6fdd5fd861a54c877 Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Tue, 8 Dec 2020 00:09:10 +0100 Subject: [PATCH] [meta] Use safer calloc for integer overflow check (#1166) --- meta/saisanitycheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/saisanitycheck.c b/meta/saisanitycheck.c index a0118f395..e6967a0e6 100644 --- a/meta/saisanitycheck.c +++ b/meta/saisanitycheck.c @@ -2588,7 +2588,7 @@ void check_attr_condition_met( uint32_t count = (uint32_t)md->conditionslength; - sai_attribute_t *attrs = (sai_attribute_t*)malloc(sizeof(sai_attribute_t) * count); + sai_attribute_t *attrs = (sai_attribute_t*)calloc(count, sizeof(sai_attribute_t)); size_t idx = 0;