MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #22777 All Revisions ] Back to Issue ]
Summary 0022777: Visualization - Unsafe way to get attribute values from MeshVS_Drawer
Revision 2017-07-21 10:49 by kgv
Description There 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	
Revision 2011-10-24 16:27 by san
Description There 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.



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker