mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:45:50 +00:00
- Add params checking. It fixes Autoruns (9.38) crashes
svn path=/trunk/; revision=39548
This commit is contained in:
parent
0491d4e284
commit
2f6e7535b5
1 changed files with 13 additions and 9 deletions
|
@ -914,19 +914,23 @@ SearchPathA (
|
|||
BufferU.Length = wcslen(BufferU.Buffer) * sizeof(WCHAR);
|
||||
/* convert ansi (or oem) string to unicode */
|
||||
if (bIsFileApiAnsi)
|
||||
RtlUnicodeStringToAnsiString (&Buffer,
|
||||
&BufferU,
|
||||
FALSE);
|
||||
Status = RtlUnicodeStringToAnsiString(&Buffer,
|
||||
&BufferU,
|
||||
FALSE);
|
||||
else
|
||||
RtlUnicodeStringToOemString (&Buffer,
|
||||
&BufferU,
|
||||
FALSE);
|
||||
/* nul-terminate ascii string */
|
||||
Buffer.Buffer[BufferU.Length / sizeof(WCHAR)] = '\0';
|
||||
Status = RtlUnicodeStringToOemString(&Buffer,
|
||||
&BufferU,
|
||||
FALSE);
|
||||
|
||||
if (NULL != lpFilePart && BufferU.Length != 0)
|
||||
if (NT_SUCCESS(Status) && Buffer.Buffer)
|
||||
{
|
||||
/* nul-terminate ascii string */
|
||||
Buffer.Buffer[BufferU.Length / sizeof(WCHAR)] = '\0';
|
||||
|
||||
if (NULL != lpFilePart && BufferU.Length != 0)
|
||||
{
|
||||
*lpFilePart = strrchr (lpBuffer, '\\') + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue