vtkDataReader Memory Errors
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
This is a potential invalid memory write in the DecodeString() method. This would produce a segmentation fault under certain builds. This bug was verified with valgrind. The bug is related to the calls from the ReadArray() method at lines 1610 and 1629. Just before these calls a character array, decoded, of length (length+1) is being allocated. This array is then passed into DecodeString().
If the decoded string is the same length as the original string then Decode writes a value 1 byte beyond the bounds of the array on line 3033. Either the original array allocated needs to be larger or line 3033 should be
resname[reslen] = 0;
instead of
resname[reslen+1] = 0;