From 9ba1870fb9ae784b429b8e13b4ab0cc3def06aee Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 10 Nov 2009 15:20:07 +1100 Subject: [PATCH] s4:Fix regression in dsdb_dn code - all parses of the DN would be rejected This is most likely the cause of the DRS replication failures I observed with my changes. Andrew Bartlett --- source4/dsdb/schema/schema_syntax.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index d50044acd07..41d4e297aa0 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -1298,7 +1298,11 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb, /* set binary stuff */ dsdb_dn = dsdb_dn_construct(tmp_ctx, dn, id3.binary, attr->syntax->ldap_oid); - + if (!dsdb_dn) { + /* If this fails, it must be out of memory, we know the ldap_oid is valid */ + talloc_free(tmp_ctx); + W_ERROR_HAVE_NO_MEMORY(dsdb_dn); + } out->values[i] = data_blob_string_const(dsdb_dn_get_extended_linearized(out->values, dsdb_dn, 1)); talloc_free(tmp_ctx); } @@ -1342,7 +1346,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb, dsdb_dn = dsdb_dn_parse(tmp_ctx, ldb, &in->values[i], attr->syntax->ldap_oid); - if (dsdb_dn) { + if (!dsdb_dn) { talloc_free(tmp_ctx); return ntstatus_to_werror(NT_STATUS_INVALID_PARAMETER); } -- 2.11.4.GIT