Fix bug in RtlAppendUnicodeStringToString where the terminating null character was being placed in the wrong byte.

This commit is contained in:
Fisherman166 2018-11-17 21:33:53 -08:00
parent 3393ccc684
commit 3f144fc7a9
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;