projects
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix name length handing in RtlQueryAtomInAtomTable.
[reactos.git]
/
reactos
/
lib
/
rtl
/
atom.c
diff --git
a/reactos/lib/rtl/atom.c
b/reactos/lib/rtl/atom.c
index
4d49278
..
0c777ca
100644
(file)
--- a/
reactos/lib/rtl/atom.c
+++ b/
reactos/lib/rtl/atom.c
@@
-602,19
+602,10
@@
RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
if (*NameLength < Length + sizeof(WCHAR))
{
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,
{
RtlCopyMemory(AtomName,
NameString,
@@
-652,19
+643,10
@@
RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable,
if (*NameLength < Length + sizeof(WCHAR))
{
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,
{
RtlCopyMemory(AtomName,
Entry->Name,