Page MenuHomePhabricator

Fix (academic) buffer overflow in MorphologicalOperations
Closed, ResolvedPublic

Description

For the morphological operations the generic AccessByItk macros are used, which include image dimensions other than 3. In a nested template function, itk::Size is used with its dimension injected by the template, while its SetElement function is always used with values 0, 1, and 2. In some of the template instantiations, this leads to buffer overflows, as the size doesn't have enough elements.

This is an academic overflow, since we only call template instantiations with 3 dimensions. The latest Visual Studio compiler detected the potential other cases, though, and we need to fix it by using more specific macros like AccessFixedDimensionByItk, which will also improve build times and sizes of binaries.

Revisions and Commits

rMITK MITK
Restricted Differential Revision