From b19d871a1af88d58e41af7b5ac0fd74ba8a43fc7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Mar 2006 22:46:42 +0000 Subject: r14115: Fix coverity bug #23. Don't deref a potentially null ptr. Jeremy. (This used to be commit df32eb70a45150e459997c2ae92c865cd0e083f6) --- source3/rpc_parse/parse_samr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); + } } /************************************************************************* -- cgit