From: Andrew Bartlett Date: Wed, 28 Jun 2023 03:57:47 +0000 (+1200) Subject: s4-rpc_server/drsuapi: Ensure logs show DN for replicated objects, not (null) X-Git-Tag: samba-4.17.11~21 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ae4d2ac3b3dc139923143ead82353d8183dfe06;p=thirdparty%2Fsamba.git s4-rpc_server/drsuapi: Ensure logs show DN for replicated objects, not (null) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15407 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15401 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher (cherry picked from commit 17359afa627a3086ec8d6862f007a3479574a8b4) --- diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index f932cb03131..448217c03d6 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -3567,7 +3567,15 @@ allowed: getncchanges_chunk_add_objects(repl_chunk, new_objs); talloc_free(getnc_state->last_dn); - getnc_state->last_dn = talloc_move(getnc_state, &msg->dn); + /* + * talloc_steal() as we still need msg->dn to + * be a valid pointer for the log on the next + * line. + * + * msg only remains in scope for the next 25 + * lines or so anyway. + */ + getnc_state->last_dn = talloc_steal(getnc_state, msg->dn); } DEBUG(8,(__location__ ": %s object %s new tmp_highest_usn=%" PRIu64 "\n",