summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-30 02:15:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:13 -0500
commit2ed4ff13d509218785d9941dc17219958ab04223 (patch)
tree6bbba5b93c172e8a11ebe2049cac4a1a86fdff4d /source4/lib/ldb
parent5ef59e9a0a5d19c67762cb4464654dd032476a95 (diff)
downloadsamba-2ed4ff13d509218785d9941dc17219958ab04223.tar.gz
samba-2ed4ff13d509218785d9941dc17219958ab04223.tar.bz2
samba-2ed4ff13d509218785d9941dc17219958ab04223.zip
r4010: fixed parsing of null attributes in the ldb ldif parser
(This used to be commit b4fd76f78eadd8648ceed508766235e80702aa8f)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c8
-rw-r--r--source4/lib/ldb/tests/init.ldif1
2 files changed, 7 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index bd99468182..94e15805a6 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -128,7 +128,11 @@ int ldb_should_b64_encode(const struct ldb_val *val)
unsigned int i;
uint8_t *p = val->data;
- if (val->length == 0 || p[0] == ' ' || p[0] == ':') {
+ if (val->length == 0) {
+ return 0;
+ }
+
+ if (p[0] == ' ' || p[0] == ':') {
return 1;
}
@@ -377,7 +381,7 @@ static int next_attr(char **s, const char **attr, struct ldb_val *value)
*attr = *s;
- while (isspace(*p)) {
+ while (*p == ' ' || *p == '\t') {
p++;
}
diff --git a/source4/lib/ldb/tests/init.ldif b/source4/lib/ldb/tests/init.ldif
index a9ed4506fb..3b0eeffe2f 100644
--- a/source4/lib/ldb/tests/init.ldif
+++ b/source4/lib/ldb/tests/init.ldif
@@ -9,6 +9,7 @@ o: UM
o: U-M
o: U of M
description: The University of Michigan at Ann Arbor
+seeAlso:
postaladdress: University of Michigan $ 535 W. William St. $ Ann Arbor, MI 481
09 $ US
telephonenumber: +1 313 764-1817