Closed
Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone though Developer Guide and API reference
- I've searched for previous similar issues and didn't find any solution
Describe the bug
This call to GetModuleFilenameW specifies an incorrect buffer size and can result in a buffer overflow.
According to the docs the nSize
parameter should be the number of characters and not bytes that the buffer can take. This means that the system function will start truncating the returned path only if it were longer than twice the buffer size.
SDK version number
latest main branch
Platform/OS/Hardware/Device
Windows
To Reproduce (observed behavior)
N/A
Expected behavior
N/A
Logs/output
N/A
Additional context
Reported by a static Veracode scan.