git.samba.org
/
jra
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b49ec3
)
Be sure to not use strlen with NULL pointer.
author
Simo Sorce
<idra@samba.org>
Fri, 15 Jun 2001 08:00:36 +0000
(08:00 +0000)
committer
Simo Sorce
<idra@samba.org>
Fri, 15 Jun 2001 08:00:36 +0000
(08:00 +0000)
(This used to be commit
53803b008717e8606b347ed8baab78121c6e9657
)
source3/smbd/utmp.c
patch
|
blob
|
history
diff --git
a/source3/smbd/utmp.c
b/source3/smbd/utmp.c
index 486c7fe06ee9f2bd2162e00b5da0d1d0082a6f3e..f79cd43c5b176ff9d1dac0952ea772729fa1e864 100644
(file)
--- 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);