mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 18:42:14 +00:00
[NTOS:CM]
- Addendum to r66462: don't forget to check buffer length CORE-9267 svn path=/trunk/; revision=66463
This commit is contained in:
parent
2e9b11e0ea
commit
888df95a50
1 changed files with 6 additions and 9 deletions
|
@ -24,6 +24,8 @@ CmpGetNextName(IN OUT PUNICODE_STRING RemainingName,
|
|||
{
|
||||
BOOLEAN NameValid = TRUE;
|
||||
|
||||
NT_ASSERT(RemainingName->Length % sizeof(WCHAR) == 0);
|
||||
|
||||
/* Check if there's nothing left in the name */
|
||||
if (!(RemainingName->Buffer) ||
|
||||
(!RemainingName->Length) ||
|
||||
|
@ -37,7 +39,8 @@ CmpGetNextName(IN OUT PUNICODE_STRING RemainingName,
|
|||
}
|
||||
|
||||
/* Check if we have a path separator */
|
||||
while (*RemainingName->Buffer == OBJ_NAME_PATH_SEPARATOR)
|
||||
while ((RemainingName->Length) &&
|
||||
(*RemainingName->Buffer == OBJ_NAME_PATH_SEPARATOR))
|
||||
{
|
||||
/* Skip it */
|
||||
RemainingName->Buffer++;
|
||||
|
@ -47,15 +50,9 @@ CmpGetNextName(IN OUT PUNICODE_STRING RemainingName,
|
|||
|
||||
/* Start loop at where the current buffer is */
|
||||
NextName->Buffer = RemainingName->Buffer;
|
||||
while (TRUE)
|
||||
while ((RemainingName->Length) &&
|
||||
(*RemainingName->Buffer != OBJ_NAME_PATH_SEPARATOR))
|
||||
{
|
||||
/* Break out if we ran out or hit a path separator */
|
||||
if (!(RemainingName->Length) ||
|
||||
(*RemainingName->Buffer == OBJ_NAME_PATH_SEPARATOR))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Move to the next character */
|
||||
RemainingName->Buffer++;
|
||||
RemainingName->Length -= sizeof(WCHAR);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue