Index: lib/libpfctl/libpfctl.c =================================================================== --- lib/libpfctl/libpfctl.c +++ lib/libpfctl/libpfctl.c @@ -748,6 +748,9 @@ size_t new_size = nv.size + (nv.size * states->count / (found_count + 1) * 2); + /* Assume at least 2K per state. */ + new_size = MAX(2048 * states->count, new_size); + /* Our buffer is too small. Estimate what we need based * on how many states fit in the previous allocation * and how many states there are. Doubled for margin.