Project

General

Custom queries

Profile

Actions

Bug #3453

closed

coverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES) (4.1.x)

Added by Victor Julien almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

*** CID 1456680:  Incorrect expression  (IDENTICAL_BRANCHES)
/src/app-layer-modbus.c: 280 in ModbusSetTxDetectFlags()
274         return tx->logged;
275     }
276     
277     static void ModbusSetTxDetectFlags(void *vtx, uint8_t dir, uint64_t flags)
278     {
279         ModbusTransaction *tx = (ModbusTransaction *)vtx;
>>>     CID 1456680:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>     The same code is executed regardless of whether "dir & 4" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
280         if (dir & STREAM_TOSERVER) {
281             tx->detect_flags_ts = flags;
282         } else {
283             tx->detect_flags_ts = flags;
284         }
285     }

Related issues 1 (0 open1 closed)

Copied from Suricata - Bug #3434: coverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES)ClosedJeff LucovskyActions
Actions #1

Updated by Victor Julien almost 5 years ago

  • Copied from Bug #3434: coverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES) added
Actions #2

Updated by Victor Julien almost 5 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF