replmd: Check dsdb_dn for syntax errors
authorGarming Sam <garming@catalyst.net.nz>
Tue, 26 Jul 2016 21:50:33 +0000 (09:50 +1200)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2016 08:06:09 +0000 (10:06 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index caf65f330576c6720253dba4ddaf56b16b50376d..7d098355cffe978012c5f63bfe9a6c51ecfa934f 100644 (file)
@@ -813,6 +813,11 @@ static int replmd_add_fix_la(struct ldb_module *module, struct ldb_message_eleme
                NTSTATUS status;
                int ret;
 
+               if (dsdb_dn == NULL) {
+                       talloc_free(tmp_ctx);
+                       return LDB_ERR_INVALID_DN_SYNTAX;
+               }
+
                /* note that the DN already has the extended
                   components from the extended_dn_store module */
                status = dsdb_get_extended_dn_guid(dsdb_dn->dn, &target_guid, "GUID");