mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[RTL]
- Do not null terminate buffer before initializing its length in RtlDosSearchPath_Ustr. Use unicode string functions made for this purpose instead. See issue #7010 for more details. svn path=/trunk/; revision=56438
This commit is contained in:
parent
dfa925989c
commit
e5491506f1
1 changed files with 3 additions and 11 deletions
|
@ -2400,20 +2400,12 @@ RtlDosSearchPath_Ustr(IN ULONG Flags,
|
|||
}
|
||||
|
||||
/* Copy the filename */
|
||||
RtlCopyMemory(StaticCandidateString.Buffer,
|
||||
FileNameString->Buffer,
|
||||
FileNameString->Length);
|
||||
RtlCopyUnicodeString(&StaticCandidateString, FileNameString);
|
||||
|
||||
/* Copy the extension */
|
||||
RtlCopyMemory(&StaticCandidateString.Buffer[FileNameString->Length / sizeof(WCHAR)],
|
||||
ExtensionString->Buffer,
|
||||
ExtensionString->Length);
|
||||
RtlAppendUnicodeStringToString(&StaticCandidateString,
|
||||
ExtensionString);
|
||||
|
||||
/* Now NULL-terminate */
|
||||
StaticCandidateString.Buffer[StaticCandidateString.Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
|
||||
/* Finalize the length of the string to make it valid */
|
||||
StaticCandidateString.Length = FileNameString->Length + ExtensionString->Length;
|
||||
DPRINT("SB: %wZ\n", &StaticCandidateString);
|
||||
|
||||
/* And check if this file now exists */
|
||||
|
|
Loading…
Reference in a new issue