Skip to content

Commit

Permalink
Fix stack frame corruption (#241)
Browse files Browse the repository at this point in the history
`RtlGetVersion` call was passing a stack-allocated `RTL_OSVERSIONINFOW` but size set to that of`RTL_OSVERSIONINFOEXW`.

call always causes (284-276) bytes overflow.
  • Loading branch information
scuzqy authored Feb 25, 2025
1 parent 7799598 commit 55c3d63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vulkancapsviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ OSInfo getOperatingSystem()
RtlGetVersionFN RtlGetVersion = reinterpret_cast<RtlGetVersionFN>(GetProcAddress(hModule, "RtlGetVersion"));
if (RtlGetVersion) {
RTL_OSVERSIONINFOW osVersionInfo = { 0 };
osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
osVersionInfo.dwOSVersionInfoSize = sizeof(osVersionInfo);
if (RtlGetVersion(&osVersionInfo) == S_OK) {
if (osVersionInfo.dwBuildNumber >= 22000) {
osInfo.version = "11";
Expand Down

0 comments on commit 55c3d63

Please sign in to comment.