From d12fd8dcb71a85d0ecd38dd6c17d213cefcdf1c0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Mar 2006 19:13:55 +0000 Subject: [PATCH] r14090: Fix coverity bug #21, don't deref potential null. Jeremy. (This used to be commit 76c4d5212bcb5f54472c9ceac2368078ebad7a3b) --- 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 3147ae00284..79dbcfe0347 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -5972,7 +5972,11 @@ void init_sam_user_info21W(SAM_USER_INFO_21 * usr, 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); + } } /************************************************************************* -- 2.11.4.GIT