From 40e9d9a54ef65f6e2f54ce3361108e17c0eb8b8f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 31 Aug 2002 06:38:27 +0000 Subject: Avoid writing unitialised bytes to the wire (and consequent valgrind warnings) by zeroing them out if they don't have meaning. Andrew Bartlett (This used to be commit 52db44b5c01e16923393b0ec9a8d0f530be7bb2d) --- source3/rpc_parse/parse_reg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index f3018cfb37..2698e82440 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -1701,7 +1701,11 @@ BOOL reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int void init_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, POLICY_HND *pol, NTSTATUS status) { - memcpy(&r_r->pol, pol, sizeof(r_r->pol)); + if (NT_STATUS_IS_OK(status)) { + memcpy(&r_r->pol, pol, sizeof(r_r->pol)); + } else { + ZERO_STRUCT(r_r->pol); + } r_r->status = status; } -- cgit