[vtkusers] bug in vtkPythonUnmangePointer

Scott Swarts swarts at enthought.com
Fri Feb 5 10:55:52 EST 2010


We've run into a crash in vtkPythonUnmanglePointer. From python, we are 
calling SetVoidArray on a vtk array in order to share memory with a 
numpy array. The problem seems to be that SetVoidArray calls 
vtkPythonUnmanglePointer in case it is a SWIG pointer being passed in. 
vtkPythonUnmanglePointer treats the memory as a string, but there is no 
terminating null. This leads to a buffer overflow and crash. I've 
attached a script that, at least on my windows machine, causes the 
crash. I've also attached a patch to VTK5.4.2 that I'm using to work 
around the problem. 

Can we get a fix put into the next release?  Is there someplace else I 
should be reporting this problem?

Thanks,

Scott
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: overflow.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100205/d08b0c56/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vtkPythonUtil.patch
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100205/d08b0c56/attachment.txt>


More information about the vtkusers mailing list