Project

General

Profile

Actions

Bug #4952

open

scan-build: Access to field 'de_state' results in a dereference of a null pointer

Added by Victor Julien 9 months ago. Updated 8 months ago.

Status:
New
Priority:
High
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

  CC       detect.o
detect.c:1238:38: warning: Access to field 'de_state' results in a dereference of a null pointer (loaded from variable 'txd') [core.NullDereference]
    DetectEngineState *tx_de_state = txd->de_state;
                                     ^~~~~~~~~~~~~
1 warning generated.

txd is almost everywhere a part of the transaction structure, where it can't be NULL if we have a tx. However in the case of HTTP we can have a tx w/o a HTPTxUserData object which means it is possible to have a NULL txd in some edge cases.

Now a HTP tx w/o a HTPTxUserData is useless from the Suricata perspective, so I wonder if we can somehow "hide" a tx like that from Suricata.

Introduced in https://github.com/OISF/suricata/commit/1ad71b96daa2b2655691cfce2a15ccd754d9b290#diff-ee484ae4b77e59eb8b6b50f628c84ab626bd6178a6d43e1219dbc9619be7e027R1238

Actions #1

Updated by Victor Julien 9 months ago

  • Description updated (diff)
Actions #2

Updated by Victor Julien 8 months ago

So I have a branch that makes the AppLayerTxData non-optional, but need a solution for the HTPTxUserData case still.

Actions #3

Updated by Victor Julien 8 months ago

  • Assignee set to OISF Dev
Actions

Also available in: Atom PDF