Skip to content
This repository was archived by the owner on Jun 6, 2021. It is now read-only.

Commit

Permalink
include/servtree.h: fix null pointer dereference
Browse files Browse the repository at this point in the history
svs can be NULL when we are logging /stats <letter> services. so check
for that case before looking up ->logtarget.
  • Loading branch information
Janik Kleinhoff committed Aug 17, 2014
1 parent 3d953b2 commit 68207fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/servtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct service_ {

static inline const char *service_get_log_target(const service_t *svs)
{
if (svs->logtarget != NULL)
if (svs != NULL && svs->logtarget != NULL)
return service_get_log_target(svs->logtarget);

return svs != NULL ? svs->nick : me.name;
Expand Down

0 comments on commit 68207fa

Please sign in to comment.