MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022777Open CASCADE[OCCT] OCCT:Visualizationpublic2011-10-24 16:272018-03-13 15:04
Reportersan 
Assigned Tokgv 
PrioritylowSeverityminor 
StatusassignedResolutionopen 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.5.2 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0022777: Visualization - Unsafe way to get attribute values from MeshVS_Drawer
DescriptionThere are numerous locations in MeshVS package code where some attribute's value is obtained with help of MeshVS_Drawer::Get****() methods but the return status of these methods is not checked.
Meanwhile, the local variables that are used to store the attribute values are often not initialized properly.
This is done in assumption that the drawer instance has been initialized properly, but the drawer class itself does not have this initialization logic.

This leads to a situation when many local variables might potentially hold undefined values.

For (hopefully) all supported drawer attributes, MeshVS_Mesh constructor sets some meaningful defaults. However, if MeshVS_Mesh::SetDrawer() is called by an application and the new drawer is not initialized with good defaults for all supported attributes somewhere outside MeshVS package, this might lead to the above-mentioned troubles.

To eliminate completely this kind of problems, it is necessary to review MeshVS package sources and provide some initializers for the local variables used to store values obtained from the drawer.


Severity	Code	Description	Project	File	Line	Suppression State
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_vectorprsbuilder.cxx	
326	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetInteger'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_commonsensitiveentity.cxx	
37	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
190	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
191	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
192	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
193	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
194	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
195	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
196	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
197	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_elementalcolorprsbuilder.cxx	
198	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_mesh.cxx	
151	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_mesh.cxx	
251	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
117	
Warning	C6255	_alloca indicates failure by raising a stack overflow exception.  Consider using _malloca 
instead.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	250	
Warning	C6255	_alloca indicates failure by raising a stack overflow exception.  Consider using _malloca 
instead.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	251	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
199	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
208	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
209	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
211	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetMaterial'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
219	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
246	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetMaterial'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
535	
Warning	C6255	_alloca indicates failure by raising a stack overflow exception.  Consider using _malloca 
instead.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	857	
Warning	C6263	Using _alloca in a loop:  this can quickly overflow stack.: Lines: 852	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
857	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_meshprsbuilder.cxx	
1062	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
164	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
165	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
428	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
429	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
430	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
431	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
432	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetBoolean'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_nodalcolorprsbuilder.cxx	
479	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetColor'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_textprsbuilder.cxx	
183	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_textprsbuilder.cxx	
184	
Warning	C6031	Return value ignored: 'MeshVS_Drawer::GetDouble'.	TKMeshVS	occt_vc14\src\meshvs\meshvs_textprsbuilder.cxx	
185	
Steps To ReproduceN/A
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0068226)
mkv (tester)
2017-07-12 18:46

Dear kgv,
could you please put your opinion?
(0068532)
git (administrator)
2017-07-21 10:53

Branch CR22777 has been created by kgv.

SHA-1: acb3cdf11b8cda1548a128001dc20cecb133418d


Detailed log of new commits:

Author: kgv
Date: Fri Jul 21 10:51:06 2017 +0300

    0022777: Visualization - Unsafe way to get attribute values from MeshVS_Drawer
    
    Define auxiliary macros Standard_CHECK_RETURN for asking compiler to warn about unused result.

- Issue History
Date Modified Username Field Change
2011-10-24 16:27 san New Issue
2011-10-24 16:27 san Assigned To => san
2017-07-12 18:46 mkv Note Added: 0068226
2017-07-12 18:46 mkv Assigned To san => kgv
2017-07-12 18:46 mkv Status new => assigned
2017-07-21 10:49 kgv Description Updated View Revisions
2017-07-21 10:49 kgv Steps to Reproduce Updated View Revisions
2017-07-21 10:50 kgv Summary Unsafe way to get attribute values from MeshVS_Drawer => Visualization - Unsafe way to get attribute values from MeshVS_Drawer
2017-07-21 10:53 git Note Added: 0068532
2017-07-21 10:54 kgv Target Version => 7.3.0
2018-03-13 15:04 kgv Target Version 7.3.0 => 7.4.0*


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker