Skip to content

Commit

Permalink
thcrap: fix buffer overrun in error path
Browse files Browse the repository at this point in the history
  • Loading branch information
brliron committed Jan 23, 2025
1 parent 04203b0 commit 47f0532
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thcrap/src/inject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ int Inject(const HANDLE hProcess, const wchar_t *const dll_dir, const wchar_t *c
"\n"
"\thttp://support.microsoft.com/kb/2533623/";
const size_t injectError1_len = _scwprintf(injectError1Format, dll_fn) + 1;
wchar_t *const injectError1 = (wchar_t*)malloc(injectError1_len);
wchar_t *const injectError1 = (wchar_t*)malloc(injectError1_len * 2);
swprintf(injectError1, injectError1_len, injectError1Format, dll_fn);
MessageBoxW(0, injectError1, L"Error", MB_ICONERROR);
free(injectError1);
Expand Down

0 comments on commit 47f0532

Please sign in to comment.