const uint8_t separator[] = {0x01, 0xD5, 0xCA, 0x7A};
SCInstance surifuzz;
-uint64_t forceLayer = 0;
+AppProto forceLayer = 0;
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
AppProto applayer = StringToAppProto(target_suffix + 1);
if (applayer != ALPROTO_UNKNOWN) {
forceLayer = applayer;
- printf("Forcing %s=%" PRIu64 "\n", AppProtoToString(forceLayer), forceLayer);
+ printf("Forcing %s=%" PRIu16 "\n", AppProtoToString(forceLayer), forceLayer);
return 0;
}
}
// else
const char *forceLayerStr = getenv("FUZZ_APPLAYER");
if (forceLayerStr) {
- if (ByteExtractStringUint64(&forceLayer, 10, 0, forceLayerStr) < 0) {
+ if (ByteExtractStringUint16(&forceLayer, 10, 0, forceLayerStr) < 0) {
forceLayer = 0;
printf("Invalid numeric value for FUZZ_APPLAYER environment variable");
} else {
f->flags |= FLOW_IPV4;
f->src.addr_data32[0] = 0x01020304;
f->dst.addr_data32[0] = 0x05060708;
- f->sp = (data[2] << 8) | data[3];
- f->dp = (data[4] << 8) | data[5];
+ f->sp = (uint16_t)((data[2] << 8) | data[3]);
+ f->dp = (uint16_t)((data[4] << 8) | data[5]);
f->proto = data[1];
memset(&ssn, 0, sizeof(TcpSession));
f->protoctx = &ssn;
alpd_tctx = AppLayerProtoDetectGetCtxThread();
}
- f = TestHelperBuildFlow(AF_INET, "1.2.3.4", "5.6.7.8", (data[2] << 8) | data[3], (data[4] << 8) | data[5]);
+ f = TestHelperBuildFlow(AF_INET, "1.2.3.4", "5.6.7.8", (uint16_t)((data[2] << 8) | data[3]),
+ (uint16_t)((data[4] << 8) | data[5]));
if (f == NULL) {
return 0;
}