This was confusing static analyzers, which thought that using [1] meant that
its size really was 1.
/* @UNSAFE */
k = i_malloc(MALLOC_ADD(sizeof(struct mail_keywords),
- MALLOC_MULTIPLY(sizeof(k->idx), (count-1))));
+ MALLOC_MULTIPLY(sizeof(k->idx[0]), count)));
k->index = index;
k->refcount = 1;
/* @UNSAFE */
k = i_malloc(MALLOC_ADD(sizeof(struct mail_keywords),
- MALLOC_MULTIPLY(sizeof(k->idx), (count-1))));
+ MALLOC_MULTIPLY(sizeof(k->idx[0]), count)));
k->index = index;
k->refcount = 1;
int refcount;
/* variable sized list of keyword indexes */
- unsigned int idx[1];
+ unsigned int idx[FLEXIBLE_ARRAY_MEMBER];
};
enum mail_index_transaction_flags {