Actions
Bug #6255
closedflow: possible divide by zero at start up
Affected Versions:
Effort:
Difficulty:
Label:
Description
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 1539152: Integer handling issues (DIVIDE_BY_ZERO)
/src/flow.c: 672 in FlowInitConfig()
________________________________________________________________________________________________________
*** CID 1539152: Integer handling issues (DIVIDE_BY_ZERO)
/src/flow.c: 672 in FlowInitConfig()
666 SC_ATOMIC_GET(flow_memuse), SC_ATOMIC_GET(flow_config.memcap));
667 }
668
669 FlowInitFlowProto();
670
671 uint32_t sz = sizeof(Flow) + FlowStorageSize();
>>> CID 1539152: Integer handling issues (DIVIDE_BY_ZERO)
>>> In expression "flow_memcap_copy / sz / flow_config.hash_size", division by expression "flow_config.hash_size" which may be zero has undefined behavior.
672 SCLogConfig("flow size %u, memcap allows for %" PRIu64 " flows. Per hash row in perfect "
673 "conditions %" PRIu64,
674 sz, flow_memcap_copy / sz, (flow_memcap_copy / sz) / flow_config.hash_size);
675 return;
676 }
677
Actions