summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-14 21:36:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:26 -0500
commita1e0a0e9286fbe90ca04cda9df38e72d8d18b0c1 (patch)
tree14c15c8333572c5a2e089611ee61d03010a9d2b4 /source3/smbd
parent2b99951e7511d0ec2d928c06b05fe22b7b6572d1 (diff)
downloadsamba-a1e0a0e9286fbe90ca04cda9df38e72d8d18b0c1.tar.gz
samba-a1e0a0e9286fbe90ca04cda9df38e72d8d18b0c1.tar.bz2
samba-a1e0a0e9286fbe90ca04cda9df38e72d8d18b0c1.zip
r16230: Fix Klocwork #861 and others. localtime and asctime
can return NULL. Ensure we check all returns correctly. Jeremy. (This used to be commit 6c61dc8ed6d84f310ef391fb7700e93ef42c4afc)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/lanman.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 4d4d9d2259..7d1a2ade54 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -2212,6 +2212,9 @@ static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid, char *param,ch
/* the client expects to get localtime, not GMT, in this bit
(I think, this needs testing) */
t = localtime(&unixdate);
+ if (!t) {
+ return False;
+ }
SIVAL(p,4,0); /* msecs ? */
SCVAL(p,8,t->tm_hour);