Commit f32b7944 authored by David Gobbi's avatar David Gobbi

BUG: another small fix to pointer mangling in vtkPythonUtil.cxx

parent f2411033
......@@ -1360,13 +1360,16 @@ void *vtkPythonUtil::UnmanglePointer(char *ptrText, int *len, const char *type)
{
strncpy(text, ptrText, *len);
text[*len] = '\0';
// Verify that there are no null bytes
for (i = *len; i > 0; i--)
i = *len;
// Allow one null byte, in case trailing null is part of *len
if (i > 0 && text[i-1] == '\0')
{
if (text[i-1] == '\0')
{
break;
}
i--;
}
// Verify that there are no other null bytes
while (i > 0 && text[i-1] != '\0')
{
i--;
}
// If no null bytes, then do a full check for a swig pointer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment