detect: config checks alstate before getting tx

Ticket: 4972

As is done in detect-lua-extensions.
We can have a flow with alproto unknown, no state, and therefore
cannot run AppLayerParserGetTx which could try to run a NULL
function

(cherry picked from commit dccf2e4c30)
pull/7288/head
Philippe Antoine 4 years ago committed by Shivani Bhardwaj
parent 483194893e
commit da824d8252

@ -89,6 +89,9 @@ void DetectConfigRegister(void)
static void ConfigApplyTx(Flow *f,
const uint64_t tx_id, const DetectConfigData *config)
{
if (f->alstate == NULL) {
return;
}
void *tx = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, tx_id);
if (tx) {
AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, tx);

Loading…
Cancel
Save