microsoft / microsoft/Windows-Driver-Developer-Supplemental-Tools
snprintf family of functions marked deprecated mustfix without a viable replacement
Nobody has claimed this yet.
- Dominant language
- CodeQL
- Stars
- 85
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
The snprintf family of functions has no appropriate replacements and should not be marked deprecated mustfix. In particular, snprintf can be used in the absence of a buffer (represented by a null buffer of zero length) to determine the required buffer size. NTStrSafe replacements such as RtlStringCbPrintf simply are not designed to return the required buffer size in any way, while the snprintf_s family consider a null buffer of zero length a programming error that results in the invocation of the invalid argument handler.
The fix would be trivial: implement the _scprintf family of functions in the WDK.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the CodeQL rule or configuration that marks the snprintf family as deprecated mustfix; the issue names no file or test. Read how comparable C library functions are classified, then verify that the rule no longer requires an inappropriate replacement and that the _scprintf family is represented as the intended alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100