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…
Reference in New Issue
Block a user