mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Fix name length handing in RtlQueryAtomInAtomTable.
svn path=/trunk/; revision=16999
This commit is contained in:
parent
1eaff64466
commit
e51757630c
1 changed files with 6 additions and 24 deletions
|
@ -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;
|
||||
Status = STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
*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;
|
||||
Status = STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
*NameLength = Length;
|
||||
Status = STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
if (Length)
|
||||
else
|
||||
{
|
||||
RtlCopyMemory(AtomName,
|
||||
Entry->Name,
|
||||
|
|
Loading…
Reference in a new issue