Fixed a bug in AppendUnicodeStringToString which could cause a null to

be placed one position after the end of a completely full string.

svn path=/trunk/; revision=8191
This commit is contained in:
Art Yerkes 2004-02-15 07:04:45 +00:00
parent b900afead3
commit 757ff359b5

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.36 2004/02/03 14:37:35 ekohl Exp $
/* $Id: unicode.c,v 1.37 2004/02/15 07:04:45 arty Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -203,7 +203,8 @@ RtlAppendUnicodeStringToString(
memcpy((PVOID)Destination->Buffer + Destination->Length, Source->Buffer, Source->Length);
Destination->Length += Source->Length;
Destination->Buffer[Destination->Length / sizeof(WCHAR)] = 0;
if( Destination->MaximumLength > Destination->Length )
Destination->Buffer[Destination->Length / sizeof(WCHAR)] = 0;
return STATUS_SUCCESS;
}