Project

General

Profile

Actions

Bug #6255

closed

flow: possible divide by zero at start up

Added by Victor Julien over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
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     

Related issues 1 (0 open1 closed)

Related to Suricata - Optimization #5920: investigate: check and fix unhandled divisions by 0ClosedPhilippe AntoineActions
Actions

Also available in: Atom PDF