Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VTK
VTK
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 378
    • Issues 378
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 77
    • Merge Requests 77
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • VTK
  • VTKVTK
  • Issues
  • #17079

Closed
Open
Opened Jul 05, 2017 by davidspaik@davidspaik
  • Report abuse
  • New issue
Report abuse New issue

vtkWidgetSet broken for all widgets other than vtkParallelopipedWidget

Using VTK 7.1.1.

In vtkWidgetSet::AddWidget(), there is a very bad bug where a pointer to a vtkAbstractWidget is static_cast to vtkParallelopipedWidget and one of its data members is set. Since there is no RTTI check, this fails very badly for any widgets in a widget set other than this one sub-class causing undefined behavior.

The obvious short term solution is to do a dynamic_cast and check against nullptr to make sure that w is actually a vtkParallelopipedWidget before setting one of its data members.

But in the longer term, this is probably a sign of a flawed design and this line should be completely removed.

Furthermore, is this code covered by a unit test? If so, the test must not be catching this problem.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
1
Labels
triage:needswork
Assign labels
  • View project labels
Reference: vtk/vtk#17079