MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030550Community[OCCT] OCCT:Foundation Classespublic2019-03-09 17:422019-03-09 17:42
Reportergalbramc 
Assigned Toabv 
PrioritynormalSeveritymajor 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target VersionFixed in Version 
Summary0030550: Integer overflow in Standard_CString HashCodes
DescriptionI compiled OCCT with the -fsanitize=undefined flag and got the following errors:

src/Standard/Standard_CString.cxx:52:19: runtime error: left shift of 1949099841 by 5 places cannot be represented in type 'int'
src/Standard/Standard_CString.cxx:52:25: runtime error: signed integer overflow: 855879620 + 1618344064 cannot be represented in type 'int'
src/Standard/Standard_CString.cxx:52:25: runtime error: signed integer overflow: 65441945 + 2094142240 cannot be represented in type 'int'

I can provide a specific example string that reproduces this if needed.

A simple fix is to change 'Standard_Integer hash' to 'Standard_Size hash', as well as the return value of the function.
Steps To ReproduceCompile OCCT with a g++ newer than 4.9 with the -fsanitize=undefined compiler flag and run the test suite.
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-03-09 17:42 galbramc New Issue
2019-03-09 17:42 galbramc Assigned To => abv


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker