summaryrefslogtreecommitdiff
path: root/source3/smbd/utmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/utmp.c')
-rw-r--r--source3/smbd/utmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c
index 486c7fe06e..f79cd43c5b 100644
--- a/source3/smbd/utmp.c
+++ b/source3/smbd/utmp.c
@@ -391,7 +391,8 @@ static void sys_utmp_update(struct utmp *u, const char *hostname, BOOL claim)
getutmpx(u, &ux);
#if defined(HAVE_UX_UT_SYSLEN)
- ux.ut_syslen = strlen(hostname) + 1; /* include end NULL */
+ if (hostname) ux.ut_syslen = strlen(hostname) + 1; /* include end NULL */
+ else ux.ut_syslen = 0;
#endif
safe_strcpy(ux.ut_host, hostname, sizeof(ux.ut_host)-1);