From be39b73ccd0f44a53b1b03c47cc0b5687d20eda2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 12 Jul 2016 18:28:23 +0200 Subject: [PATCH] dsdb: Fix CID 1363810: Null pointer dereferences The if-condition explicitly tests for new_schema==NULL, so this seems to be a valid error case. The DEBUG statement would segfault in this case. Signed-off-by: Volker Lendecke Reviewed-by: Ira Cooper Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Jul 13 06:34:33 CEST 2016 on sn-devel-144 --- source4/dsdb/repl/replicated_objects.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index 88ba598ba6b..6d39dba4833 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -891,9 +891,12 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context *ldb, * unable to operate for other users from this * point... */ if (new_schema == NULL || new_schema == working_schema) { - DEBUG(0,("Failed to re-load schema after commit of transaction (working: %p/%llu, new: %p/%llu)\n", - new_schema, (unsigned long long)new_schema->metadata_usn, - working_schema, (unsigned long long)working_schema->metadata_usn)); + DBG_ERR("Failed to re-load schema after commit of " + "transaction (working: %p/%"PRIu64", new: " + "%p/%"PRIu64")\n", new_schema, + new_schema != NULL ? + new_schema->metadata_usn : 0, + working_schema, working_schema->metadata_usn); dsdb_reference_schema(ldb, cur_schema, false); if (used_global_schema) { dsdb_set_global_schema(ldb); -- 2.47.3