Actions
Bug #3434
closedcoverity: CID 1456680: Incorrect expression (IDENTICAL_BRANCHES)
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 }
Actions