From e4ec2be93d675b120f1bffbff497d9ed8628c2a6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 28 Dec 2012 11:26:26 -0800 Subject: [PATCH] Better handling of missing entries Treat zero-length entries properly (as missing entries) in entry_next() and entry_get_int(). --- servers/slapd/back-mdb/tools.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/slapd/back-mdb/tools.c b/servers/slapd/back-mdb/tools.c index b444e3a53f..6aae331484 100644 --- a/servers/slapd/back-mdb/tools.c +++ b/servers/slapd/back-mdb/tools.c @@ -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; -- 2.39.5