From 5f211a7dcc151ac372a11a29c95c7687312850f7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 13 Jul 2009 15:22:46 +0000 Subject: [PATCH] Fix handling for empty results --- servers/slapd/overlays/sssvlv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/servers/slapd/overlays/sssvlv.c b/servers/slapd/overlays/sssvlv.c index 707f6820ea..e7d3b853f2 100644 --- a/servers/slapd/overlays/sssvlv.c +++ b/servers/slapd/overlays/sssvlv.c @@ -536,6 +536,9 @@ static void send_entry( "%s: response control: status=%d, text=%s\n", debug_header, rs->sr_err, SAFESTR(rs->sr_text, "")); + if ( !so->so_tree ) + return; + /* RFC 2891: If critical then send the entries iff they were * succesfully sorted. If non-critical send all entries * whether they were sorted or not. @@ -811,8 +814,11 @@ static int sssvlv_op_search( } else { so->so_paged = 0; so->so_page_size = 0; - if ( vc ) + if ( vc ) { so->so_vlv = op->o_ctrlflag[vlv_cid]; + so->so_vlv_target = 0; + so->so_vlv_rc = 0; + } } so->so_vcontext = (unsigned long)so; so->so_nentries = 0; -- 2.39.5