mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 12:47:16 +00:00
[FREELDR]: Don't use a null pointer for strstr call.
CORE-8198 #resolve #comment Fixed. svn path=/trunk/; revision=66141
This commit is contained in:
parent
434111e8b0
commit
3536a8463e
1 changed files with 13 additions and 14 deletions
|
@ -242,34 +242,33 @@ WinLdrInitializeHeadlessPort(VOID)
|
||||||
VOID
|
VOID
|
||||||
WinLdrSetupEms(IN PCHAR BootOptions)
|
WinLdrSetupEms(IN PCHAR BootOptions)
|
||||||
{
|
{
|
||||||
PCHAR RedirectPort;
|
PCHAR Settings;
|
||||||
|
|
||||||
/* Start fresh */
|
/* Start fresh */
|
||||||
RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK));
|
RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK));
|
||||||
LoaderRedirectionInformation.PciDeviceId = PCI_INVALID_VENDORID;
|
LoaderRedirectionInformation.PciDeviceId = PCI_INVALID_VENDORID;
|
||||||
|
|
||||||
/* Use a direction port if one was given, or use ACPI to detect one instead */
|
/* Use a direction port if one was given, or use ACPI to detect one instead */
|
||||||
RedirectPort = strstr(BootOptions, "/redirect=");
|
Settings = strstr(BootOptions, "/redirect=");
|
||||||
|
if (Settings)
|
||||||
if (RedirectPort)
|
|
||||||
{
|
{
|
||||||
RedirectPort = strstr(RedirectPort, "com");
|
PCHAR RedirectPort = strstr(Settings, "com");
|
||||||
if (RedirectPort)
|
if (RedirectPort)
|
||||||
{
|
{
|
||||||
RedirectPort += sizeof("com") - 1;
|
RedirectPort += sizeof("com") - 1;
|
||||||
LoaderRedirectionInformation.PortNumber = atoi(RedirectPort);
|
LoaderRedirectionInformation.PortNumber = atoi(RedirectPort);
|
||||||
LoaderRedirectionInformation.TerminalType = 1; //HeadlessSerialPort
|
LoaderRedirectionInformation.TerminalType = 1; // HeadlessSerialPort
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RedirectPort = strstr(RedirectPort, "usebiossettings");
|
Settings = strstr(Settings, "usebiossettings");
|
||||||
if (RedirectPort)
|
if (Settings)
|
||||||
{
|
{
|
||||||
UiDrawStatusText("ACPI SRT Table Not Supported...");
|
UiDrawStatusText("ACPI SRT Table Not Supported...");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoaderRedirectionInformation.PortAddress = (PUCHAR)strtoul(RedirectPort, 0, 16);
|
LoaderRedirectionInformation.PortAddress = (PUCHAR)strtoul(Settings, 0, 16);
|
||||||
if (LoaderRedirectionInformation.PortAddress)
|
if (LoaderRedirectionInformation.PortAddress)
|
||||||
{
|
{
|
||||||
LoaderRedirectionInformation.PortNumber = 3;
|
LoaderRedirectionInformation.PortNumber = 3;
|
||||||
|
@ -279,18 +278,18 @@ WinLdrSetupEms(IN PCHAR BootOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use a direction baudrate if one was given */
|
/* Use a direction baudrate if one was given */
|
||||||
RedirectPort = strstr(BootOptions, "/redirectbaudrate=");
|
Settings = strstr(BootOptions, "/redirectbaudrate=");
|
||||||
if (RedirectPort)
|
if (Settings)
|
||||||
{
|
{
|
||||||
if (strstr(RedirectPort, "115200"))
|
if (strstr(Settings, "115200"))
|
||||||
{
|
{
|
||||||
LoaderRedirectionInformation.BaudRate = 115200;
|
LoaderRedirectionInformation.BaudRate = 115200;
|
||||||
}
|
}
|
||||||
else if (strstr(RedirectPort, "57600"))
|
else if (strstr(Settings, "57600"))
|
||||||
{
|
{
|
||||||
LoaderRedirectionInformation.BaudRate = 57600;
|
LoaderRedirectionInformation.BaudRate = 57600;
|
||||||
}
|
}
|
||||||
else if (strstr(RedirectPort, "19200"))
|
else if (strstr(Settings, "19200"))
|
||||||
{
|
{
|
||||||
LoaderRedirectionInformation.BaudRate = 19200;
|
LoaderRedirectionInformation.BaudRate = 19200;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue