mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
- Fix RtlInitUnicodeStringEx for NULL case (spotted by Herv� Poussineau).
svn path=/trunk/; revision=11949
This commit is contained in:
parent
3d7ae60229
commit
9a8220ce63
1 changed files with 11 additions and 5 deletions
|
@ -504,18 +504,24 @@ NTSTATUS STDCALL
|
|||
RtlInitUnicodeStringEx(OUT PUNICODE_STRING DestinationString,
|
||||
IN PCWSTR SourceString)
|
||||
{
|
||||
ULONG Length = 0;
|
||||
ULONG Length;
|
||||
|
||||
if (SourceString != NULL)
|
||||
{
|
||||
Length = wcslen(SourceString) * sizeof(WCHAR);
|
||||
if (Length > 0xFFFC)
|
||||
return STATUS_NAME_TOO_LONG;
|
||||
}
|
||||
|
||||
DestinationString->Length = Length;
|
||||
DestinationString->MaximumLength = Length + sizeof(WCHAR);
|
||||
DestinationString->Buffer = (PWSTR)SourceString;
|
||||
DestinationString->Length = Length;
|
||||
DestinationString->MaximumLength = Length + sizeof(WCHAR);
|
||||
DestinationString->Buffer = (PWSTR)SourceString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DestinationString->Length = 0;
|
||||
DestinationString->MaximumLength = 0;
|
||||
DestinationString->Buffer = NULL;
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue