Project

General

Profile

Actions

Bug #3434

closed

coverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES)

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:
Needs backport

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 to Suricata - Bug #3453: coverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES) (4.1.x)ClosedVictor JulienActions
Actions

Also available in: Atom PDF