You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RIOT maps the various logging calls of ccn-lite to printf. Below is a snippet from ccnl-riot-logging.h (in ccn-lite).
55#defineDEBUGMSG(LVL, ...) do { \
56 if ((LVL)>debug_level) break; \
57 LOG(LVL, __VA_ARGS__); \
58 } while (0)
and in RIOT LOG points to log_write points to printf (see core/include/log.h in RIOT)
#definelog_write(level, ...) printf(__VA_ARGS__)
The function ccnl_addr2ascii ccn-lite returns NULL if no valid parameter was passed to it. If one embeds a call to ccnl_addr2ascii in a logging macro call and passes NULL as a argument, the function returns NULL. Subsequently, the NULL which is passed to a %s leads to undefined behaviour (most likely a crash).
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".
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: