From addb1320a46df16691253f7c4562e8176cd74e75 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 25 Jul 2009 00:09:56 +0000 Subject: [PATCH] More cleanup --- servers/slapd/overlays/sssvlv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/sssvlv.c b/servers/slapd/overlays/sssvlv.c index 4db21d3b3b..8dccdab02c 100644 --- a/servers/slapd/overlays/sssvlv.c +++ b/servers/slapd/overlays/sssvlv.c @@ -34,6 +34,8 @@ #include "lutil.h" #include "config.h" +#include "../../../libraries/liblber/lber-int.h" /* ber_rewind */ + /* RFC2891: Server Side Sorting * RFC2696: Paged Results */ @@ -76,7 +78,7 @@ typedef struct sort_key typedef struct sort_ctrl { int sc_nkeys; - sort_key sc_keys[0]; + sort_key sc_keys[1]; } sort_ctrl; @@ -1000,7 +1002,7 @@ static int sss_parseCtrl( i = count_key( ber ); sc = op->o_tmpalloc( sizeof(sort_ctrl) + - i * sizeof(sort_key), op->o_tmpmemctx ); + (i-1) * sizeof(sort_key), op->o_tmpmemctx ); sc->sc_nkeys = i; op->o_controls[sss_cid] = sc; -- 2.39.5