mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ISO C forbids zero-size array (ITS#3739)
This commit is contained in:
parent
7b0d820ce5
commit
e799b27eed
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user