-
-
Notifications
You must be signed in to change notification settings - Fork 706
Open
Labels
type:CompilerCompiler support or related warningsCompiler support or related warningstype:StyleStyle changes: no logic impact (indentation, comments, naming)Style changes: no logic impact (indentation, comments, naming)
Milestone
Description
Description
Allowing users to specify formatting strings at runtime is a well known exploitable code security vulnerability.
We currently suppress these warnings, but it would be better to re-write the codebase to avoid the security vulnerability all together.
Steps to Reproduce
ITK_GCC_PRAGMA_PUSH
ITK_GCC_SUPPRESS_Wformat_nonliteral
snprintf(fileName, IOCommon::ITK_MAXPATHLEN + 1, m_SeriesFormat.c_str(), fileNumber);
ITK_GCC_PRAGMA_POP
Expected behavior
No warning suppression and no security vulnerability.
Actual behavior
When ITK_GCC_SUPPRESS_Wformat_nonliteral supression are disabled, warnings are issued.
Reproducibility
New compilers, and requesting -Wformat-nonliteral
Versions
Since the earliest versions of ITK to at least 2024-04-29
Additional Information
Metadata
Metadata
Assignees
Labels
type:CompilerCompiler support or related warningsCompiler support or related warningstype:StyleStyle changes: no logic impact (indentation, comments, naming)Style changes: no logic impact (indentation, comments, naming)