Commit 97566cf4 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#7483

Better handling of missing entries

Treat zero-length entries properly (as missing entries) in entry_next()
and entry_get_int().
parent 0a30fb74
...@@ -231,6 +231,9 @@ next:; ...@@ -231,6 +231,9 @@ next:;
previd = *(ID *)key.mv_data; previd = *(ID *)key.mv_data;
id = previd; id = previd;
if ( !data.mv_size )
goto next;
if ( tool_filter || tool_base ) { if ( tool_filter || tool_base ) {
static Operation op = {0}; static Operation op = {0};
static Opheader ohdr = {0}; static Opheader ohdr = {0};
...@@ -326,6 +329,10 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep ) ...@@ -326,6 +329,10 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep )
goto done; goto done;
} }
} }
if ( !data.mv_size ) {
rc = LDAP_NO_SUCH_OBJECT;
goto done;
}
op.o_hdr = &ohdr; op.o_hdr = &ohdr;
op.o_bd = be; op.o_bd = be;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment