mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 09:24:12 +08:00
fix buffer overrun
This commit is contained in:
parent
650e2077ca
commit
50472a98ea
@ -244,7 +244,7 @@ DWORD WINAPI TextHook::Reader(LPVOID hookPtr)
|
|||||||
|
|
||||||
if (This->hp.type & USING_UNICODE) dataLen = wcslen((wchar_t*)currentAddress) * 2;
|
if (This->hp.type & USING_UNICODE) dataLen = wcslen((wchar_t*)currentAddress) * 2;
|
||||||
else dataLen = strlen((char*)currentAddress);
|
else dataLen = strlen((char*)currentAddress);
|
||||||
|
if (dataLen > PIPE_BUFFER_SIZE - 1) continue; // results in silly error msg but oh well
|
||||||
memcpy(buffer, (void*)currentAddress, dataLen + 1);
|
memcpy(buffer, (void*)currentAddress, dataLen + 1);
|
||||||
TextOutput({ GetCurrentProcessId(), This->address, 0, 0 }, buffer, dataLen);
|
TextOutput({ GetCurrentProcessId(), This->address, 0, 0 }, buffer, dataLen);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user