cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

fixes sizeof mismatch error in test_prefix_to_path #296

Closed mfrey closed 6 years ago

mfrey commented 6 years ago

Contribution description

There was a sizeof mismatch in test_prefix_to_path. Instead of

11   struct ccnl_prefix_s *p = ccnl_malloc(sizeof(struct ccnl_prefix_s));
12   p->compcnt = 3;
13   p->comp = ccnl_malloc(sizeof(char*) * p->compcnt);

it should be

11   struct ccnl_prefix_s *p = ccnl_malloc(sizeof(struct ccnl_prefix_s));
12   p->compcnt = 3;
13   p->comp = (unsigned char**)ccnl_malloc(sizeof(unsigned char*) * p->compcnt);

The sizeof mismatch was identified by clangs static analyzer.