summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/common/dsdb_dn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/dsdb/common/dsdb_dn.c b/source4/dsdb/common/dsdb_dn.c
index b53de409fe..0029f5d49e 100644
--- a/source4/dsdb/common/dsdb_dn.c
+++ b/source4/dsdb/common/dsdb_dn.c
@@ -87,6 +87,11 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
char *dn_str;
enum dsdb_dn_format dn_format = dsdb_dn_oid_to_format(dn_oid);
+
+ if (dn_blob == NULL || dn_blob->data == NULL || dn_blob->length == 0) {
+ return NULL;
+ }
+
switch (dn_format) {
case DSDB_INVALID_DN:
return NULL;
@@ -113,16 +118,11 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
return NULL;
}
- if (dn_blob && dn_blob->data
- && (strlen((const char*)dn_blob->data) != dn_blob->length)) {
+ if (strlen((const char*)dn_blob->data) != dn_blob->length) {
/* The RDN must not contain a character with value 0x0 */
return NULL;
}
-
- if (!dn_blob->data || dn_blob->length == 0) {
- return NULL;
- }
-
+
tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return NULL;