mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
[freeldr] Never suppose that buffer in UNICODE_STRING is null terminated. Fixes some random failures when loading drivers
svn path=/trunk/; revision=46190
This commit is contained in:
parent
78f8948c0f
commit
9a46a46011
|
@ -232,7 +232,7 @@ WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
PVOID DriverBase;
|
PVOID DriverBase;
|
||||||
|
|
||||||
// Separate the path to file name and directory path
|
// Separate the path to file name and directory path
|
||||||
sprintf(DriverPath, "%S", FilePath->Buffer);
|
snprintf(DriverPath, sizeof(DriverPath), "%wZ", FilePath);
|
||||||
DriverNamePos = strrchr(DriverPath, '\\');
|
DriverNamePos = strrchr(DriverPath, '\\');
|
||||||
if (DriverNamePos != NULL)
|
if (DriverNamePos != NULL)
|
||||||
{
|
{
|
||||||
|
@ -261,7 +261,7 @@ WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's not loaded, we have to load it
|
// It's not loaded, we have to load it
|
||||||
sprintf(FullPath,"%s%S", BootPath, FilePath->Buffer);
|
snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
|
||||||
Status = WinLdrLoadImage(FullPath, LoaderBootDriver, &DriverBase);
|
Status = WinLdrLoadImage(FullPath, LoaderBootDriver, &DriverBase);
|
||||||
if (!Status)
|
if (!Status)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue