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

Fixes #334

Closed
wants to merge 9 commits into from
Closed

Fixes #334

wants to merge 9 commits into from

Conversation

blacksheeep
Copy link
Contributor

This pull request should fix some of the problematic typing problem and other potentional security fixes

Contribution description

Fix, Type Confusions, Unsafe Function Calls,...

@mfrey
Copy link
Collaborator

mfrey commented Dec 13, 2018

You shouldn't update your feature branch by merging your master into the feature branch, but by using fetch/rebase. Doing otherwise is considered bad style.

@mfrey mfrey self-requested a review December 13, 2018 10:45
@mfrey
Copy link
Collaborator

mfrey commented Dec 13, 2018

I suggest to make a clean new feature branch and cherry-pick the corresponding commits over to the new (clean) branch.

Copy link
Contributor Author

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

I have one point:
can we change the variable suite to unsigned.
and to a unique datasize?

int
ccnl_pkt_mkComponent(int suite, unsigned char *dst, char *src, int srclen);
size_t
ccnl_pkt_mkComponent(int suite, uint8_t *dst, char *src, size_t srclen);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suite is here a int, should be unsigned.

struct ccnl_prefix_s*
ccnl_prefix_new(int suite, int cnt);
struct ccnl_prefix_s*
ccnl_prefix_new(char suite, uint32_t cnt);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suite is here a char, should be unsigned and either int or char.

#include <stdbool.h>
#include <stddef.h>

bool
ccnl_isSuite(int suite);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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? bool was introduced as a type in C99

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently we have kernel support, therefore there is no support for C99

unsigned char *hmacSignature;
uint8_t *hmacStart;
size_t hmacLen;
uint8_t *hmacSignature;
#endif
unsigned int flags;
char suite;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unsigned?

int compcnt; /**< number of name components */
uint8_t **comp; /**< name components of the prefix without '\0' at the end */
size_t *complen; /**< length of the name components */
uint32_t compcnt; /**< number of name components */
char suite; /**< type of the packet format */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unsigned

@blacksheeep
Copy link
Contributor Author

Currently CCN-Lite is not C99 compiled, which causes an error when compiling for loops with iterator defined in the for loop

@blacksheeep
Copy link
Contributor Author

I suggest to make a clean new feature branch and cherry-pick the corresponding commits over to the new (clean) branch.

How important is this, in case we squash the commits anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants