MantisBT - VTK
View Issue Details
0006851VTK(No Category)public2008-04-18 19:352012-12-12 12:15
Clinton Stimpson 
David Gobbi 
normalminoralways
closedfixed 
 
5.8.0 
0006851: vtkVariant crash

vtkObject* o = NULL;
vtkVariant v(o); // <- crashes

Also a
vtkVariant v(NULL);
gives me a compiler warning
warning: passing NULL to non-pointer argument 1 of ‘vtkVariant::vtkVariant(long int)’

Which isn't the constructur I might have intended to call.
No tags attached.
Issue History
2008-04-18 19:35Clinton StimpsonNew Issue
2011-04-16 19:32David GobbiAssigned To => David Gobbi
2011-04-16 19:32David GobbiStatusbacklog => tabled
2011-04-16 19:40David GobbiNote Added: 0026200
2011-04-16 19:40David GobbiStatustabled => @80@
2011-04-16 19:40David GobbiResolutionopen => fixed
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2012-12-12 12:15David GobbiStatuscustomer review => closed
2012-12-12 12:15David GobbiFixed in Version => 5.8.0

Notes
(0026200)
David Gobbi   
2011-04-16 19:40   
Construction vtkVariant with vtkVariant(0) or vtkVariant(NULL)
is ambiguous purely due to the way VTK handles overloads.

As for the null pointer to vtkObject crash, it was fixed last year:

commit f9dbbc16dd4064f4678e8fe36cc9bb92abd7d37b
Author: David Gobbi <david.gobbi@gmail.com>
Date: Fri May 7 19:24:04 2010 -0600

BUG: constructing with null pointer caused a segfault

This changes the behavior of the constructor so that if given
a null string or null vtkObject pointer, the result is an invalid
vtkVariant instead of a crash.