Author: tridge
Date: 2004-11-30 02:15:43 +0000 (Tue, 30 Nov 2004)
New Revision: 4010

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4010

Log:
fixed parsing of null attributes in the ldb ldif parser

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_ldif.c
   branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_ldif.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_ldif.c 2004-11-30 01:01:43 UTC 
(rev 4009)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_ldif.c 2004-11-30 02:15:43 UTC 
(rev 4010)
@@ -128,7 +128,11 @@
        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 @@
 
        *attr = *s;
 
-       while (isspace(*p)) {
+       while (*p == ' ' || *p == '\t') {
                p++;
        }
 

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif   2004-11-30 01:01:43 UTC 
(rev 4009)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/init.ldif   2004-11-30 02:15:43 UTC 
(rev 4010)
@@ -9,6 +9,7 @@
 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

Reply via email to