Fix name length handing in RtlQueryAtomInAtomTable.

svn path=/trunk/; revision=16999
This commit is contained in:
Filip Navara 2005-08-03 14:45:39 +00:00
parent 1eaff64466
commit e51757630c

View file

@ -602,19 +602,10 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
if (*NameLength < Length + sizeof(WCHAR))
{
/* prevent underflow! */
if (*NameLength >= sizeof(WCHAR))
{
Length = *NameLength - sizeof(WCHAR);
}
else
{
Length = 0;
*NameLength = Length;
Status = STATUS_BUFFER_TOO_SMALL;
}
}
if (Length)
else
{
RtlCopyMemory(AtomName,
NameString,
@ -652,19 +643,10 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
if (*NameLength < Length + sizeof(WCHAR))
{
/* prevent underflow! */
if (*NameLength >= sizeof(WCHAR))
{
Length = *NameLength - sizeof(WCHAR);
}
else
{
Length = 0;
*NameLength = Length;
Status = STATUS_BUFFER_TOO_SMALL;
}
}
if (Length)
else
{
RtlCopyMemory(AtomName,
Entry->Name,