test_var_expand_SOURCE = test-var-expand.c
test_var_expand_LDADD = $(test_libs)
+
+if USE_FUZZER
+fuzz_programs = fuzz-var-expand
+
+nodist_EXTRA_fuzz_var_expand_SOURCES = force-cxx-linking.cxx
+
+fuzz_var_expand_CPPFLAGS = $(FUZZER_CPPFLAGS)
+fuzz_var_expand_LDFLAGS = $(FUZZER_LDFLAGS)
+fuzz_var_expand_SOURCES = fuzz-var-expand.c
+fuzz_var_expand_LDADD = $(test_libs)
+fuzz_var_expand_DEPENDENCIES = libvar_expand.la
+
+noinst_PROGRAMS += $(fuzz_programs)
+
+endif
+
+check-local:
+ for bin in $(test_programs); do \
+ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \
+ done
--- /dev/null
+/* Copyright (c) 2025 Dovecot authors, see the included COPYING file */
+
+#include "lib.h"
+#include "fuzzer.h"
+#include "var-expand.h"
+
+FUZZ_BEGIN_STR(const char *input)
+{
+ struct var_expand_program *program = NULL;
+ const char *error ATTR_UNUSED;
+ if (var_expand_program_create(input, &program, &error) == 0)
+ var_expand_program_free(&program);
+}
+FUZZ_END