From e799b27eed270f7e9458c3119a376ca35817f304 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 21 May 2005 00:08:28 +0000 Subject: [PATCH] ISO C forbids zero-size array (ITS#3739) --- servers/slapd/bconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 3a1d41969b..de62eae274 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -3167,7 +3167,7 @@ out: typedef struct delrec { struct delrec *next; int nidx; - int idx[0]; + int idx[1]; } delrec; static int @@ -3226,7 +3226,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, if ( ct && ml->sml_values ) { delrec *d; for (i=0; ml->sml_values[i].bv_val; i++); - d = ch_malloc( sizeof(delrec) + i * sizeof(int)); + d = ch_malloc( sizeof(delrec) + (i - 1)* sizeof(int)); d->nidx = i; d->next = NULL; if ( dels ) { -- 2.39.5