diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-06-13 19:56:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:25 -0500 |
commit | 0372e0372297ef02c65d033b73db602a562f72cd (patch) | |
tree | 03d3bd48fe92c51f6e3435cf6f7bc8badd06d017 | |
parent | a47ffac30d3363a93182584859ab273cfc3de2d3 (diff) | |
download | samba-0372e0372297ef02c65d033b73db602a562f72cd.tar.gz samba-0372e0372297ef02c65d033b73db602a562f72cd.tar.bz2 samba-0372e0372297ef02c65d033b73db602a562f72cd.zip |
r16204: Fix Klocwork # 14
localtime() can return NULL.
Volker
(This used to be commit 07c5dcb8633e6fadb596dc5a22d8d31b2e16a3ef)
-rw-r--r-- | source3/auth/auth_sam.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 50ce9065fd..e8018eb13d 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -93,9 +93,11 @@ static BOOL logon_hours_ok(struct samu *sampass) bitmask = 1 << (bitpos % 8); if (! (hours[bitpos/8] & bitmask)) { - DEBUG(1,("logon_hours_ok: Account for user %s not allowed to logon at this time (%s).\n", - pdb_get_username(sampass), - asctime(localtime(&lasttime)) )); + struct tm *t = localtime(&lasttime); + DEBUG(1, ("logon_hours_ok: Account for user %s not allowed to " + "logon at this time (%s).\n", + pdb_get_username(sampass), + t ? asctime(t) : "INVALID TIME")); return False; } |