mirror of
https://github.com/reactos/reactos.git
synced 2024-10-23 14:36:11 +00:00
Use *NameLength before overwriting it
svn path=/trunk/; revision=8429
This commit is contained in:
parent
9187c6f654
commit
82cff84c9a
|
@ -1,4 +1,4 @@
|
|||
/* $Id: atom.c,v 1.8 2003/12/07 10:31:21 navaraf Exp $
|
||||
/* $Id: atom.c,v 1.9 2004/02/27 23:11:32 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -641,13 +641,14 @@ RtlQueryAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable,
|
|||
|
||||
if (NameLength != NULL)
|
||||
{
|
||||
*NameLength = AtomEntry->Name.Length;
|
||||
if (AtomName != NULL && *NameLength >= AtomEntry->Name.Length)
|
||||
{
|
||||
*NameLength = AtomEntry->Name.Length;
|
||||
memcpy(AtomName, AtomEntry->Name.Buffer, AtomEntry->Name.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
*NameLength = AtomEntry->Name.Length;
|
||||
RtlpUnlockAtomTable(AtomTable);
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue