afl: fix compile warnings for decoder fuzz funcs

pull/4159/head
Victor Julien 7 years ago
parent a472dec865
commit 399ab35aa1

@ -38,6 +38,16 @@
#include "flow.h"
#ifdef AFLFUZZ_DECODER
int AFLDecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
const uint8_t *pkt, uint32_t len, PacketQueue *pq)
{
return DecodeIPV4(tv, dtv, p, pkt, (uint16_t)len, pq);
}
int AFLDecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
const uint8_t *pkt, uint32_t len, PacketQueue *pq)
{
return DecodeIPV6(tv, dtv, p, pkt, (uint16_t)len, pq);
}
/* stateful processing of data as packets. Because AFL in case of a
* crash will only safe the last input, we dump all the inputs to a

@ -952,10 +952,13 @@ void DecodeIPV6FragHeader(Packet *p, uint8_t *pkt,
void AddressDebugPrint(Address *);
#ifdef AFLFUZZ_DECODER
typedef int (*DecoderFunc)(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
uint8_t *pkt, uint32_t len, PacketQueue *pq);
const uint8_t *pkt, uint32_t len, PacketQueue *pq);
#ifdef AFLFUZZ_DECODER
int AFLDecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
const uint8_t *pkt, uint32_t len, PacketQueue *pq);
int AFLDecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
const uint8_t *pkt, uint32_t len, PacketQueue *pq);
int DecoderParseDataFromFile(char *filename, DecoderFunc Decoder);
int DecoderParseDataFromFileSerie(char *fileprefix, DecoderFunc Decoder);
#endif

@ -1371,18 +1371,18 @@ static void ParseCommandLineAFL(const char *opt_name, char *opt_arg)
SpmTableSetup();
AppLayerProtoDetectSetup();
if (strcmp(opt_name, "afl-decoder-ipv4") == 0)
exit(DecoderParseDataFromFile(opt_arg, DecodeIPV4));
exit(DecoderParseDataFromFile(opt_arg, AFLDecodeIPV4));
else
exit(DecoderParseDataFromFileSerie(opt_arg, DecodeIPV4));
exit(DecoderParseDataFromFileSerie(opt_arg, AFLDecodeIPV4));
} else if(strstr(opt_name, "afl-decoder-ipv6") != NULL) {
StatsInit();
MpmTableSetup();
SpmTableSetup();
AppLayerProtoDetectSetup();
if (strcmp(opt_name, "afl-decoder-ipv6") == 0)
exit(DecoderParseDataFromFile(opt_arg, DecodeIPV6));
exit(DecoderParseDataFromFile(opt_arg, AFLDecodeIPV6));
else
exit(DecoderParseDataFromFileSerie(opt_arg, DecodeIPV6));
exit(DecoderParseDataFromFileSerie(opt_arg, AFLDecodeIPV6));
} else if(strstr(opt_name, "afl-decoder-ethernet") != NULL) {
StatsInit();
MpmTableSetup();

Loading…
Cancel
Save