microsoft / microsoft/wil

`wil::zstring_view` `data` and `c_str` are not SAL annotated to indicate `_Ret_z_`, triggering analyzers

Open
#278 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

The implementation of wil::zstring_view does not have SAL annotations to indicate that the pointer returned by the data and c_str points to a null-terminated sequence. We are trying to use WIL's string view to improve safety and prevent the analyzer from flagging every usage of std's string_view, especially when we forcefully need to return raw pointers across-ABI interactions. Is there a plan to add annotations? Thanks in advance!

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 implementation and declarations of wil::zstring_view::data and c_str, then inspect nearby SAL annotation conventions. Add annotations that communicate null termination and verify that the intended analyzer no longer flags raw-pointer uses across ABI interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.