Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addressed 'NULL' issue in ccnl_i_prefixof_c #297

Merged
merged 1 commit into from
Aug 2, 2018

Conversation

mfrey
Copy link
Collaborator

@mfrey mfrey commented Aug 2, 2018

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).

blacksheeep
blacksheeep previously approved these changes Aug 2, 2018
Copy link
Contributor

@blacksheeep blacksheeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks good to me

* @return 0 if full match
* @return n>0 for matched components
*/
int
ccnl_i_prefixof_c(struct ccnl_prefix_s *prefix,
int ccnl_i_prefixof_c(struct ccnl_prefix_s *prefix,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering about this re-alignement here. All other signatures start with the return type and the function name in the below line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should start to talk about a style guide soon.

* @return 0 if full match
* @return n>0 for matched components
*/
int
int
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is here an extra whitespace?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

cgundogan
cgundogan previously approved these changes Aug 2, 2018
Copy link
Collaborator

@cgundogan cgundogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@cgundogan cgundogan merged commit 46a98ff into cn-uofbasel:master Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants