From 9b70bdfc38f20fb34c3b192819552d1e48cefed7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 15 Jun 2001 08:00:36 +0000 Subject: Be sure to not use strlen with NULL pointer. (This used to be commit 53803b008717e8606b347ed8baab78121c6e9657) --- source3/smbd/utmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/smbd/utmp.c') 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); -- cgit