Skip to content

Commit

Permalink
Remove BUG_ON(1) in app layer event second stage preparation function.
Browse files Browse the repository at this point in the history
This lets us single out and print rules that result in a failure, than
just post a core dump.
  • Loading branch information
poona authored and victorjulien committed Jan 17, 2014
1 parent 92a821c commit d06a193
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/detect-app-layer-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int DetectAppLayerEventParseAppP2(DetectAppLayerEventData *data,
} else if (ipproto_bitarray[IPPROTO_UDP / 8] & 1 << (IPPROTO_UDP % 8)) {
ipproto = IPPROTO_UDP;
} else {
BUG_ON(1);
return -1;
}

r = AppLayerParserGetEventInfo(ipproto, data->alproto,
Expand Down
3 changes: 2 additions & 1 deletion src/detect-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,8 @@ static Signature *SigInitHelper(DetectEngineCtx *de_ctx, char *sigstr,
AppLayerProtoDetectSupportedIpprotos(sig->alproto, sig->proto.proto);
}

DetectAppLayerEventPrepare(sig);
if (DetectAppLayerEventPrepare(sig) < 0)
goto error;

/* set mpm_content_len */

Expand Down

0 comments on commit d06a193

Please sign in to comment.