Skip to content

C++: Model secure versions of scanf as flow sources#21856

Draft
MathiasVP wants to merge 5 commits into
github:mainfrom
MathiasVP:scanf-safe-functions
Draft

C++: Model secure versions of scanf as flow sources#21856
MathiasVP wants to merge 5 commits into
github:mainfrom
MathiasVP:scanf-safe-functions

Conversation

@MathiasVP
Copy link
Copy Markdown
Contributor

@MathiasVP MathiasVP commented May 15, 2026

Does what it says on the tin.

There are a couple of small details that need to be fixed in order to model these as flow sources: since every string-like output buffer is succeeded by a buffer size argument we cannot blindly mark all variadic argument as an output buffer.

To fix this we switch from modeling these functions as flow sources by extending LocalFlowSourceFunction (and RemoteFlowSourceFunction) to directly extending LocalFlowSource (and RemoteFlowSource) so we can consider individual calls (instead of the functions).

Commit-by-commit review recommended.

@MathiasVP MathiasVP force-pushed the scanf-safe-functions branch from c81bd73 to 4d76e8d Compare May 15, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant