Skip to content

Commit

Permalink
[meta] Use safer calloc for integer overflow check (sonic-net#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Dec 7, 2020
1 parent b908a5b commit f14f406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f14f406

Please sign in to comment.