static inline int flexarray_append(struct flexarray *flex, void *data)
{
    return flexarray_set(flex, flexarray_size(flex), data);
}

The product reads data past the end, or before the beginning, of the intended buffer.