-
Notifications
You must be signed in to change notification settings - Fork 63
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
ccnl_addr2ascii returns NULL pointer #232
Comments
This issue probably also applies to other logging mappings in ccn-lite. |
I think we should stick with "NULL" as a return value and simply remove all parts of the code which pass clearly "NULL" to the function. Any thoughts? |
I've removed the "bug" label. I think that the function is simply applied in a wrongful way. A developer should check if the function returns NULL before simply passing it to a format string which expects a string such as "%s". @blacksheeep any thoughts? |
RIOT maps the various logging calls of ccn-lite to
printf
. Below is a snippet fromccnl-riot-logging.h
(in ccn-lite).and in RIOT
LOG
points tolog_write
points toprintf
(seecore/include/log.h
in RIOT)The function
ccnl_addr2ascii
ccn-lite returnsNULL
if no valid parameter was passed to it. If one embeds a call toccnl_addr2ascii
in a logging macro call and passesNULL
as a argument, the function returnsNULL
. Subsequently, theNULL
which is passed to a%s
leads to undefined behaviour (most likely a crash).This can for example observed in
ccnl_fwd.c
, e.g.This issue is related to #231
The text was updated successfully, but these errors were encountered: