diff --git a/drivers/syslog/vsyslog.c b/drivers/syslog/vsyslog.c index f486dec645b..5592995c176 100644 --- a/drivers/syslog/vsyslog.c +++ b/drivers/syslog/vsyslog.c @@ -206,7 +206,8 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) /* Prepend the process name */ tcb = nxsched_get_tcb(getpid()); - ret += lib_sprintf(&stream.public, "%s: ", tcb->name); + ret += lib_sprintf(&stream.public, "%s: ", + (tcb != NULL) ? tcb->name : "(null)"); #endif /* Generate the output */