On 05/16/2013 10:45 AM, Anoop Saldanha wrote:
> In src/app-layer-parser.c:
> 
>>  
>> -                SCLogDebug("inspect_id %"PRIu16", avail_id %"PRIu16,
>> -                        parser_state_store->inspect_id,
>> -                        parser_state_store->avail_id);
>> -            } else {
>> -                /* done but no more transactions available */
>> -                r = 1;
>> +    for (; idx < total_txs; idx++, tx_updated_by++) {
>> +        tx = AppLayerGetTx(f->alproto, f->alstate, idx);
> 
> It can't be NULL at this point.

For http, GetTx is defined as:

static void *HTPStateGetTx(void *alstate, uint64_t tx_id)
{
    return list_get(((htp_tx_t *)alstate)->connp->conn->transactions,
tx_id);
}

In OOM conditions we have seen NULLs returned by list_get before I think.

Think we should always check, also to catch errors in other protocols'
GetTx implementation (if they do return NULL in some error case).