Author: hpoussin
Date: Sat Mar 13 23:56:41 2010
New Revision: 46190
URL:
http://svn.reactos.org/svn/reactos?rev=46190&view=rev
Log:
[freeldr] Never suppose that buffer in UNICODE_STRING is null terminated. Fixes some
random failures when loading drivers
Modified:
trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Sat Mar 13 23:56:41
2010
@@ -232,7 +232,7 @@
PVOID DriverBase;
// Separate the path to file name and directory path
- sprintf(DriverPath, "%S", FilePath->Buffer);
+ snprintf(DriverPath, sizeof(DriverPath), "%wZ", FilePath);
DriverNamePos = strrchr(DriverPath, '\\');
if (DriverNamePos != NULL)
{
@@ -261,7 +261,7 @@
}
// 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);
if (!Status)
return FALSE;