summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-11-07 12:06:11 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-11-12 16:34:07 +1100
commit4e2b4be9d3bd406a303b74c8d5ebd56714a337ae (patch)
treef193bbff37f9460d0d6a85f2196e3780106563b2 /source4
parentd6d0c23d49fd299d292b30338a9fc0ffcdaf1f2e (diff)
downloadsamba-4e2b4be9d3bd406a303b74c8d5ebd56714a337ae.tar.gz
samba-4e2b4be9d3bd406a303b74c8d5ebd56714a337ae.tar.bz2
samba-4e2b4be9d3bd406a303b74c8d5ebd56714a337ae.zip
s4:dsdb Ensure we allow 'odd' lengths for DN+String
(Found in a code review by metze) Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/common/dsdb_dn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/dsdb/common/dsdb_dn.c b/source4/dsdb/common/dsdb_dn.c
index 3605a6a056..6c20d09910 100644
--- a/source4/dsdb/common/dsdb_dn.c
+++ b/source4/dsdb/common/dsdb_dn.c
@@ -149,11 +149,6 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
p1 = p2+1;
len--;
- if ((blen % 2 != 0)) {
- DEBUG(10, (__location__ ": blen=%u - not an even number\n", (unsigned)blen));
- goto failed;
- }
-
if (blen >= len) {
DEBUG(10, (__location__ ": blen=%u len=%u\n", (unsigned)blen, (unsigned)len));
goto failed;
@@ -169,6 +164,11 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
switch (dn_format) {
case DSDB_BINARY_DN:
+ if ((blen % 2 != 0)) {
+ DEBUG(10, (__location__ ": blen=%u - not an even number\n", (unsigned)blen));
+ goto failed;
+ }
+
if (blen >= 2) {
bval.length = (blen/2)+1;
bval.data = talloc_size(tmp_ctx, bval.length);