From: Philippe Antoine Date: Mon, 29 Jul 2024 14:10:11 +0000 (+0200) Subject: fuzz: make confyaml.c an explicit source X-Git-Tag: suricata-7.0.7~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33783269aec3616307c1f5b2758e4799a1c5f212;p=thirdparty%2Fsuricata.git fuzz: make confyaml.c an explicit source Ticket: 7181 Allows confyaml.c to be in the release archive (cherry picked from commit 3f8251bd47d4445befe38a57fe1485374657d246) --- diff --git a/src/Makefile.am b/src/Makefile.am index 582be4585c..8377d39e48 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1343,7 +1343,7 @@ if BUILD_FUZZTARGETS LDFLAGS_FUZZ = $(all_libraries) $(SECLDFLAGS) LDADD_FUZZ = libsuricata_c.a $(RUST_SURICATA_LIB) $(HTP_LDADD) $(RUST_LDADD) -fuzz_applayerprotodetectgetproto_SOURCES = tests/fuzz/fuzz_applayerprotodetectgetproto.c +fuzz_applayerprotodetectgetproto_SOURCES = tests/fuzz/fuzz_applayerprotodetectgetproto.c tests/fuzz/confyaml.c fuzz_applayerprotodetectgetproto_LDFLAGS = $(LDFLAGS_FUZZ) fuzz_applayerprotodetectgetproto_LDADD = $(LDADD_FUZZ) if HAS_FUZZLDFLAGS @@ -1354,7 +1354,7 @@ endif # force usage of CXX for linker nodist_EXTRA_fuzz_applayerprotodetectgetproto_SOURCES = force-cxx-linking.cxx -fuzz_applayerparserparse_SOURCES = tests/fuzz/fuzz_applayerparserparse.c +fuzz_applayerparserparse_SOURCES = tests/fuzz/fuzz_applayerparserparse.c tests/fuzz/confyaml.c fuzz_applayerparserparse_LDFLAGS = $(LDFLAGS_FUZZ) fuzz_applayerparserparse_LDADD = $(LDADD_FUZZ) if HAS_FUZZLDFLAGS @@ -1398,7 +1398,7 @@ endif # force usage of CXX for linker nodist_EXTRA_fuzz_decodepcapfile_SOURCES = force-cxx-linking.cxx -fuzz_sigpcap_SOURCES = tests/fuzz/fuzz_sigpcap.c +fuzz_sigpcap_SOURCES = tests/fuzz/fuzz_sigpcap.c tests/fuzz/confyaml.c fuzz_sigpcap_LDFLAGS = $(LDFLAGS_FUZZ) fuzz_sigpcap_LDADD = $(LDADD_FUZZ) if HAS_FUZZLDFLAGS @@ -1410,7 +1410,7 @@ endif nodist_EXTRA_fuzz_sigpcap_SOURCES = force-cxx-linking.cxx if HAS_FUZZPCAP -fuzz_sigpcap_aware_SOURCES = tests/fuzz/fuzz_sigpcap_aware.c +fuzz_sigpcap_aware_SOURCES = tests/fuzz/fuzz_sigpcap_aware.c tests/fuzz/confyaml.c fuzz_sigpcap_aware_LDFLAGS = $(LDFLAGS_FUZZ) fuzz_sigpcap_aware_LDADD = $(LDADD_FUZZ) -lfuzzpcap if HAS_FUZZLDFLAGS @@ -1421,7 +1421,7 @@ endif # force usage of CXX for linker nodist_EXTRA_fuzz_sigpcap_aware_SOURCES = force-cxx-linking.cxx -fuzz_predefpcap_aware_SOURCES = tests/fuzz/fuzz_predefpcap_aware.c +fuzz_predefpcap_aware_SOURCES = tests/fuzz/fuzz_predefpcap_aware.c tests/fuzz/confyaml.c fuzz_predefpcap_aware_LDFLAGS = $(LDFLAGS_FUZZ) fuzz_predefpcap_aware_LDADD = $(LDADD_FUZZ) -lfuzzpcap if HAS_FUZZLDFLAGS diff --git a/src/tests/fuzz/confyaml.c b/src/tests/fuzz/confyaml.c index d36e8e3133..e67e40a347 100644 --- a/src/tests/fuzz/confyaml.c +++ b/src/tests/fuzz/confyaml.c @@ -1,4 +1,4 @@ -const char configNoChecksum[] = "\ +const char *configNoChecksum = "\ %YAML 1.1\n\ ---\n\ pcap-file:\n\ diff --git a/src/tests/fuzz/fuzz_applayerparserparse.c b/src/tests/fuzz/fuzz_applayerparserparse.c index 0ee263fc0b..820f323744 100644 --- a/src/tests/fuzz/fuzz_applayerparserparse.c +++ b/src/tests/fuzz/fuzz_applayerparserparse.c @@ -21,7 +21,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv); AppLayerParserThreadCtx *alp_tctx = NULL; -#include "confyaml.c" +extern const char *configNoChecksum; /* input buffer is structured this way : * 6 bytes header, diff --git a/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c b/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c index 598e7cc03f..34ec11e16f 100644 --- a/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c +++ b/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c @@ -18,7 +18,7 @@ //rule of thumb constant, so as not to timeout target #define PROTO_DETECT_MAX_LEN 1024 -#include "confyaml.c" +extern const char *configNoChecksum; int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); diff --git a/src/tests/fuzz/fuzz_predefpcap_aware.c b/src/tests/fuzz/fuzz_predefpcap_aware.c index c20e3d341d..1b230021f3 100644 --- a/src/tests/fuzz/fuzz_predefpcap_aware.c +++ b/src/tests/fuzz/fuzz_predefpcap_aware.c @@ -42,7 +42,7 @@ void *fwd; SCInstance surifuzz; SC_ATOMIC_EXTERN(unsigned int, engine_stage); -#include "confyaml.c" +extern const char *configNoChecksum; char *filepath = NULL; diff --git a/src/tests/fuzz/fuzz_sigpcap.c b/src/tests/fuzz/fuzz_sigpcap.c index e5bd56deb4..216aa926de 100644 --- a/src/tests/fuzz/fuzz_sigpcap.c +++ b/src/tests/fuzz/fuzz_sigpcap.c @@ -42,7 +42,7 @@ void *fwd; SCInstance surifuzz; SC_ATOMIC_EXTERN(unsigned int, engine_stage); -#include "confyaml.c" +extern const char *configNoChecksum; int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/src/tests/fuzz/fuzz_sigpcap_aware.c b/src/tests/fuzz/fuzz_sigpcap_aware.c index d245476985..ea34925f78 100644 --- a/src/tests/fuzz/fuzz_sigpcap_aware.c +++ b/src/tests/fuzz/fuzz_sigpcap_aware.c @@ -42,7 +42,7 @@ void *fwd; SCInstance surifuzz; SC_ATOMIC_EXTERN(unsigned int, engine_stage); -#include "confyaml.c" +extern const char *configNoChecksum; static void SigGenerateAware(const uint8_t *data, size_t size, char *r, size_t *len) {