[vtk-developers] vtkDataArrayTemplate.cxx writes out of bounds when malloc fails
Burlen Loring
burlen.loring at kitware.com
Fri Jun 20 09:52:42 EDT 2008
Sean McBride wrote:
> On 6/19/08 5:23 PM, Burlen Loring said:
>
>
>> Any objections/criticism/comments regarding this change?
>>
>
> We've recently observed similar problems with VTK not checking for a
> null from malloc, so your patch is appealing. Forgive me for asking
> without really looking at the patch too closely, but the exception that
> new throws, who catches it? Is it the responsibility of the user of the
> VTK library (ie my app) to guard all uses of VTK APIs with a catch? I
> seem to recall that, unlike ITK, the VTK API did not propagate
> exceptions, but I can't find such a reference right now.
>
>
Hi Sean,
My intention would be to let users of the VTK library catch it. That way
if they don't catch their application will be killed and they will have
some information about what happened. If they do implement an exception
handler, it is up to them how to handle. I don't think VTK is supposed
to explicitly throw exceptions, I may be wrong on that. Of course here
the exception is coming from outside VTK, so I think it's OK. I do see
some some try/catch blocks at various places...but the only throws I see
are in VTK/Utilities...
Thanks for your feedback.
--
Burlen Loring
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x137
More information about the vtk-developers
mailing list