Skip to content

Commit

Permalink
fix: 修复buffer溢出造成官方对战平台闪退
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveBeforT committed Sep 27, 2022
1 parent caeb34b commit ac70673
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WarcraftHelper/pathfix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ int __fastcall GetPathName(char* nameGB2312, DWORD edx, DWORD unk00, float unk01
memset(wstr, 0, len + 1);
MultiByteToWideChar(CP_ACP, 0, nameGB2312, -1, wstr, len);
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
if (len > dst_len) {
if (wstr) delete[] wstr;
return rst;
}
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, dst, len, NULL, NULL);
if (wstr) delete[] wstr;
}
Expand Down

0 comments on commit ac70673

Please sign in to comment.