cn-uofbasel / ccn-lite

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

adds check on length in ll2ascii() #335

Closed mfrey closed 5 years ago

mfrey commented 5 years ago

Contribution description

The PR adds a length check on the len parameter of ll2ascii(). If someone passes a len value of CCNL_LLADDR_STR_MAX_LEN + 2 to the function it basically overflows the out buffer (created inside the function). It also adds some documentation which clarifies why passing a string of "ffff...ff" to the ll2ascii function does not result in a string of "ff:ff:...ff"

Issues/PRs references

See also PR #333 for the initial discussion on documentation in test_ll2ascii_valid()