Warning: C26451 in win32_helpers (GetModuleFileNameExW)
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 300
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 1
Description
Running code analysis on a project including WIL headers should compile without issues flagged. Instead we get:
Warning C26451 Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2). [...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\include\wil\win32_helpers.h 333
AND:
Warning C6001 Using uninitialized memory '*pNode'. [...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\include\wil\result.h 388
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 reproducing the code-analysis warnings in win32_helpers.h at line 333 and result.h at line 388 using a project that includes WIL headers. Inspect the reported arithmetic expression and pNode usage, then rerun analysis to confirm both C26451 and C6001 are resolved without introducing new warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100