Merge pull request #1505 from Fisherman166/RtlAppendUnicodeFix

Fix bug in RtlAppendUnicodeStringToString
This commit is contained in:
Luke Usher 2018-11-18 09:17:55 +00:00 committed by GitHub
commit cdf64197a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -169,9 +169,8 @@ XBSYSAPI EXPORTNUM(262) xboxkrnl::NTSTATUS NTAPI xboxkrnl::RtlAppendUnicodeStrin
result = STATUS_BUFFER_TOO_SMALL;
}
else {
CHAR *dstBuf = (CHAR*)(Destination->Buffer + (Destination->Length / sizeof(WCHAR)));
CHAR *srcBuf = (CHAR*)(Source->Buffer);
memmove(dstBuf, srcBuf, srcLen);
WCHAR *dstBuf = (WCHAR*)(Destination->Buffer + (Destination->Length / sizeof(WCHAR)));
memmove(dstBuf, Source->Buffer, srcLen);
Destination->Length += srcLen;
if (Destination->Length < Destination->MaximumLength) {
dstBuf[srcLen / sizeof(WCHAR)] = UNICODE_NULL;