summaryrefslogtreecommitdiff
path: root/source3/smbd/utmp.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-06-15 08:00:36 +0000
committerSimo Sorce <idra@samba.org>2001-06-15 08:00:36 +0000
commit9b70bdfc38f20fb34c3b192819552d1e48cefed7 (patch)
tree55f9ba77ad5e9e1380c78f34db321c0888a6996c /source3/smbd/utmp.c
parent2b49ec356a85af27a5204bddf5058dff80c00cd2 (diff)
downloadsamba-9b70bdfc38f20fb34c3b192819552d1e48cefed7.tar.gz
samba-9b70bdfc38f20fb34c3b192819552d1e48cefed7.tar.bz2
samba-9b70bdfc38f20fb34c3b192819552d1e48cefed7.zip
Be sure to not use strlen with NULL pointer.
(This used to be commit 53803b008717e8606b347ed8baab78121c6e9657)
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);