microsoft / microsoft/Windows-Driver-Developer-Supplemental-Tools

snprintf family of functions marked deprecated mustfix without a viable replacement

Open
#226 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.