cn-uofbasel / ccn-lite

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

addressed 'NULL' issue in ccnl_i_prefixof_c #297

Closed mfrey closed 6 years ago

mfrey commented 6 years ago

Contribution description

This issue was identified by clangs static analyzer ("argument with 'nonnull' attribute passed null"). If the check in

415     md = (prefix->compcnt - p->compcnt == 1) ? compute_ccnx_digest(c->pkt->buf) : NULL;

would fail, the subsequent call to

416 return ccnl_prefix_cmp(p, md, prefix, CMP_MATCH) == prefix->compcnt;

might also fail (i.e. md is NULL).