]> git.sur5r.net Git - openldap/commitdiff
Better handling of missing entries
authorHoward Chu <hyc@openldap.org>
Fri, 28 Dec 2012 19:26:26 +0000 (11:26 -0800)
committerHoward Chu <hyc@openldap.org>
Fri, 28 Dec 2012 19:26:26 +0000 (11:26 -0800)
Treat zero-length entries properly (as missing entries) in entry_next()
and entry_get_int().

servers/slapd/back-mdb/tools.c

index b444e3a53f8e1c0dae9ca8adb23fc39e4c18af3f..6aae331484f76c33499849bf2ebf493667d09300 100644 (file)
@@ -231,6 +231,9 @@ next:;
        previd = *(ID *)key.mv_data;
        id = previd;
 
+       if ( !data.mv_size )
+               goto next;
+
        if ( tool_filter || tool_base ) {
                static Operation op = {0};
                static Opheader ohdr = {0};
@@ -326,6 +329,10 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep )
                        goto done;
                }
        }
+       if ( !data.mv_size ) {
+               rc = LDAP_NO_SUCH_OBJECT;
+               goto done;
+       }
 
        op.o_hdr = &ohdr;
        op.o_bd = be;