summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-09 22:46:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:13 -0500
commitb19d871a1af88d58e41af7b5ac0fd74ba8a43fc7 (patch)
tree128076afb14d1abfce61d37eb41e5175bc392821 /source3/rpc_parse
parent1de2983de4ea1a482c294a9ecce8437cc35ff7ee (diff)
downloadsamba-b19d871a1af88d58e41af7b5ac0fd74ba8a43fc7.tar.gz
samba-b19d871a1af88d58e41af7b5ac0fd74ba8a43fc7.tar.bz2
samba-b19d871a1af88d58e41af7b5ac0fd74ba8a43fc7.zip
r14115: Fix coverity bug #23. Don't deref a potentially null ptr.
Jeremy. (This used to be commit df32eb70a45150e459997c2ae92c865cd0e083f6)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_samr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 043bafe285..2f8fe74ed3 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -5541,7 +5541,11 @@ void init_sam_user_info23W(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all z
copy_unistr2(&usr->uni_munged_dial, mung_dial);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
- memcpy(&usr->logon_hrs, hrs, sizeof(usr->logon_hrs));
+ if (hrs) {
+ memcpy(&usr->logon_hrs, hrs, sizeof(usr->logon_hrs));
+ } else {
+ ZERO_STRUCT(usr->logon_hrs);
+ }
}
/*************************************************************************