On 05/17/2013 09:22 AM, Anoop Saldanha wrote:
> In src/detect-engine-state.c:
> 
>>                      FLOWLOCK_UNLOCK(f);
>>                      goto end;
>>                  }
>>  
>> -                int total_txs = (int)list_size(htp_state->connp->conn->transactions);
>> -                for ( ; tx_id < total_txs; tx_id++) {
>> -                    DetectEngineAppInspectionEngine *engine =
>> -                        app_inspection_engine[ALPROTO_HTTP][(flags & STREAM_TOSERVER) ? 0 : 1];
>> -                    while (engine != NULL) {
>> -                        if (s->sm_lists[engine->sm_list] != NULL && !(item->flags & engine->match_flags)) {
>> +                engine = app_inspection_engine[alproto][(flags & STREAM_TOSERVER) ? 0 : 1];
>> +                void *inspect_tx = AppLayerGetTx(alproto, alstate, inspect_tx_id);
> 
> We delete txs only upto inspect_id - 1;
> 

I think we should just add the check. It's cheap and it will be a safe
guard against mistakes in our tx handling api and all the tx alproto's
we may add.