Open
Conversation
A small bug, that leads to out of bound memory access. Crashes when I use windbg with gflags. ```windbg kdclient64!memcpy+0x250: 000007fe`dc2642f0 488b440af8 mov rax,qword ptr [rdx+rcx-8] ds:00000000`36c19040=???????????????? ``` backtrace ```windbg ~kv dclient64!memcpy+0x250 [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\src\amd64\memcpy.asm @ 344] 00000000`37ddf890 000007fe`dc25b5d6 : 00000000`34ab6cf0 000007fe`dc276e88 00000000`34ab6cf0 00000000`37ddfa70 : kdclient64!SessionNameFromVMWareCmdLineW+0x187 [e:\projects\sysprogs-github\virtualkd\kdclient\patchapi.cpp @ 159] 00000000`37ddf920 000007fe`dc254b91 : 00000000`37ddfa70 00000000`00000001 00000000`00000000 00000000`00000000 : kdclient64!SessionNameFromVMCmdLineW+0x1a6 [e:\projects\sysprogs-github\virtualkd\kdclient\patchapi.cpp @ 180] 00000000`37ddf9c0 00000000`773759cd : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kdclient64!PatcherThreadMain+0x101 [e:\projects\sysprogs-github\virtualkd\kdclient\kdclient.cpp @ 106] ``` The root cause of the bug is that you accidentally use sizeof(wchat_t *) instead of sizeof(wchat_t )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small bug, that leads to out of bound memory access.
Crashes when I use windbg with gflags.
backtrace
The root cause of the bug is that you accidentally use sizeof(wchat_t *) instead of sizeof(wchat_t )