]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fuzz: build compatibility with oss-fuzz flags 4780/head
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 6 Apr 2020 08:58:23 +0000 (10:58 +0200)
committerPhilippe Antoine <contact@catenacyber.fr>
Mon, 6 Apr 2020 08:58:23 +0000 (10:58 +0200)
ie C define FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION

src/app-layer-htp.c
src/suricata.c

index eb1ef119f9b9e1f63b1d5837206876f2ec90a4e5..cb10867fd48b7630230770a37b378179ca0b2ce1 100644 (file)
@@ -6482,6 +6482,8 @@ static int HTPParserTest16(void)
         goto end;
     }
 
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+//these events are disabled during fuzzing as they are too noisy and consume much resource
     FLOWLOCK_WRLOCK(f);
     void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0);
     AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, txtmp);
@@ -6501,6 +6503,7 @@ static int HTPParserTest16(void)
         printf("HTTP_DECODER_EVENT_URI_DELIM_NON_COMPLIANT not set: ");
         goto end;
     }
+#endif
 
     result = 1;
 end:
index eb497c488a0fad26de2da4a6490b494f0ed17b9a..0cc79eea5bc64e46bb904f817c8d86db9e0f7227 100644 (file)
@@ -281,6 +281,7 @@ int RunmodeGetCurrent(void)
  *  construction, etc.
  */
 
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 static void SignalHandlerSigint(/*@unused@*/ int sig)
 {
     sigint_count = 1;
@@ -289,6 +290,8 @@ static void SignalHandlerSigterm(/*@unused@*/ int sig)
 {
     sigterm_count = 1;
 }
+#endif
+
 #ifndef OS_WIN32
 /**
  * SIGUSR2 handler.  Just set sigusr2_count.  The main loop will act on