MantisBT - Open CASCADE |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0026377 | Open CASCADE | [OCCT] OCCT:Foundation Classes | public | 2015-06-28 13:46 | 2016-04-20 15:51 |
|
Reporter | abv | |
Assigned To | abv | |
Priority | normal | Severity | minor | |
Status | closed | Resolution | fixed | |
Platform | | OS | | OS Version | |
Product Version | | |
Target Version | [OCCT] 7.0.0 | Fixed in Version | [OCCT] 7.0.0 | |
Test case number | |
|
Summary | 0026377: Passing Handle objects as arguments to functions as non-const reference to base type is dangerous |
Description | As pointed out by Roman Lygin, passing Handle object as argument to function accepting non-const reference to handle to base type may be dangerous, as the handle can be modified by that function, and there is no guarantee that the new object pointed by it will be compatible with the original handle type.
Example:
Handle(TDataStd_Real) A;
if (Label.FindAttribute (TDataStd_Integer::GetID(), A)) {
// A is used as TData_Std_Real, while the object pointed by it is TDataStd_Integer
}
It would be good to have protection in this situation, to ensure that either exception is raised or at least handle is nullified if it is assigned non-compatible type. This should be possible when new handles are implemented in the frames of 0024023 |
Steps To Reproduce | Not required |
Additional information and documentation updates | |
Tags | No tags attached. |
Relationships | related to | 0024023 | closed | abv | Open CASCADE | Revamp the OCCT Handle | related to | 0027104 | closed | abv | Community | DownCast() cannot return null for mismatched handle | related to | 0027111 | closed | abv | Community | Add generalized copy constructor in handle class for old compilers | related to | 0027185 | closed | bugmaster | Open CASCADE | Data Exchange - IGES - incorrect reading of DE for undefined entity |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2015-06-28 13:46 | abv | New Issue | |
2015-06-28 13:46 | abv | Assigned To | => abv |
2015-06-28 13:57 | abv | Relationship added | related to 0024023 |
2015-06-29 07:08 | git | Note Added: 0042518 | |
2015-12-14 22:39 | abv | Target Version | 7.0.0 => 7.1.0 |
2016-01-21 16:30 | Roman Lygin | Relationship added | related to 0026497 |
2016-01-21 16:31 | Roman Lygin | Relationship deleted | related to 0026497 |
2016-01-21 16:31 | Roman Lygin | Relationship added | related to 0027104 |
2016-01-25 20:36 | Roman Lygin | Relationship added | related to 0027111 |
2016-02-18 19:00 | abv | Relationship added | related to 0027185 |
2016-02-19 11:02 | bugmaster | Status | new => resolved |
2016-02-19 11:02 | bugmaster | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=13010#r13010 |
2016-02-19 11:02 | bugmaster | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=13011#r13011 |
2016-02-19 11:03 | bugmaster | Assigned To | abv => bugmaster |
2016-02-19 11:03 | bugmaster | Status | resolved => reviewed |
2016-02-19 11:03 | bugmaster | Note Added: 0050997 | |
2016-02-19 11:03 | bugmaster | Status | reviewed => tested |
2016-02-19 11:21 | abv | Target Version | 7.1.0 => 7.0.0 |
2016-02-21 08:52 | abv | Changeset attached | => occt master aa00364d |
2016-02-21 08:52 | abv | Assigned To | bugmaster => abv |
2016-02-21 08:52 | abv | Status | tested => verified |
2016-02-21 08:52 | abv | Resolution | open => fixed |
2016-04-17 15:06 | git | Note Added: 0053250 | |
2016-04-20 15:42 | aiv | Fixed in Version | => 7.0.0 |
2016-04-20 15:51 | aiv | Status | verified => closed |