aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fuzz/fuzz-conv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fuzz/fuzz-conv.c b/fuzz/fuzz-conv.c
index 5817e5d..b067378 100644
--- a/fuzz/fuzz-conv.c
+++ b/fuzz/fuzz-conv.c
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
+#include <gc.h>
#include "wc.h"
char *get_null_terminated(const uint8_t *data, size_t size) {
@@ -14,6 +15,13 @@ char *get_null_terminated(const uint8_t *data, size_t size) {
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
+ static int init_done = 0;
+
+ if (!init_done) {
+ GC_INIT();
+ init_done = 1;
+ }
+
if (size < 30) {
return 0;
}