fuzz: fixes a leak in applayerparse target

If a protocol change was requested, the target did not handle
it as Suricata, as the target is meant to handle only one
app-layer protocol.

(cherry picked from commit ca054f7264)
pull/8212/head
Philippe Antoine 5 years ago committed by Victor Julien
parent 0324a9b20b
commit b9be616406

@ -133,6 +133,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
memcpy(isolatedBuffer, albuffer, alnext - albuffer);
(void) AppLayerParserParse(NULL, alp_tctx, f, f->alproto, flags, isolatedBuffer, alnext - albuffer);
free(isolatedBuffer);
if (FlowChangeProto(f)) {
// exits if a protocol change is requested
alsize = 0;
break;
}
flags &= ~(STREAM_START);
if (f->alparser &&
(((flags & STREAM_TOSERVER) != 0 &&

Loading…
Cancel
Save