View Issue Details

IDProjectCategoryView StatusLast Update
0030608Open CASCADEOCCT:Foundation Classespublic2023-08-01 15:08
ReportertizmayloAssigned Tovpozdyayev 
PrioritynormalSeverityminor 
Status newResolutionopen 
Product Version7.3.0 
Target VersionUnscheduled 
Summary0030608: Foundation Classes - Undefined behavior caused by overflow in arithmetic operations with signed integers in HashCode() functions
DescriptionThere is a number of places in the code of HashCode() functions where an overflow in arithmetic operations with signed integers may possibly occur. E.g., look at BRepMesh_Triangle::HashCode:

inline Standard_Integer HashCode(const Standard_Integer theUpper) const
{
  return ::HashCode(myEdges[0] + myEdges[1] + myEdges[2], theUpper);
}

There are three signed integer that are summed up. If they would big enough, an overflow might occur. But in accordance with the C++ standard a signed integer arithmetic overflow is an undefined behavior.
TagsNo tags attached.
Test case number

Relationships

related to 0030550 closedbugmaster Community Coding - Integer overflow in Standard_CString HashCodes 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-03-26 15:14 tizmaylo New Issue
2019-03-26 15:14 tizmaylo Assigned To => kgv
2019-03-26 15:14 tizmaylo Relationship added related to 0030550
2019-09-04 18:27 kgv Summary Undefined behavior caused by overflow in arithmetic operations with signed integers in HashCode() functions => Foundation Classes - Undefined behavior caused by overflow in arithmetic operations with signed integers in HashCode() functions
2019-09-05 04:52 abv Target Version 7.4.0 => 7.5.0
2020-08-28 14:31 kgv Target Version 7.5.0 => 7.6.0
2021-08-24 15:01 kgv Target Version 7.6.0 => 7.7.0
2022-10-19 15:55 smoskvin Assigned To kgv => vpozdyayev
2022-10-24 10:40 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:08 dpasukhi Target Version 7.8.0 => Unscheduled