Project

General

Profile

Actions

Bug #6255

closed

flow: possible divide by zero at start up

Added by Victor Julien over 1 year ago. Updated over 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 #1

Updated by Jeff Lucovsky over 1 year ago

  • Subject changed from flow: possible devide by zero at start up to flow: possible divide by zero at start up
  • Status changed from New to In Progress
  • Assignee changed from OISF Dev to Jeff Lucovsky
Actions #2

Updated by Jeff Lucovsky over 1 year ago

  • Status changed from In Progress to In Review
Actions #3

Updated by Philippe Antoine over 1 year ago

  • Related to Optimization #5920: investigate: check and fix unhandled divisions by 0 added
Actions #4

Updated by Philippe Antoine over 1 year ago

  • Assignee changed from Jeff Lucovsky to Philippe Antoine
Actions #5

Updated by Philippe Antoine over 1 year ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF