mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +00:00
[NTOS:IO] Fail if the driver name passed to NtLoadDriver() is an empty string.
Otherwise an assertion on the driver name is hit later on. Can be reproduced by calling NtLoadDriver with a valid UNICODE_STRING of Length == 0.
This commit is contained in:
parent
44511f0809
commit
a748350fc9
|
@ -1251,7 +1251,7 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
||||||
DPRINT("IopUnloadDriver('%wZ', %u)\n", &CapturedServiceName, UnloadPnpDrivers);
|
DPRINT("IopUnloadDriver('%wZ', %u)\n", &CapturedServiceName, UnloadPnpDrivers);
|
||||||
|
|
||||||
/* We need a service name */
|
/* We need a service name */
|
||||||
if (CapturedServiceName.Length == 0)
|
if (CapturedServiceName.Length == 0 || CapturedServiceName.Buffer == NULL)
|
||||||
{
|
{
|
||||||
ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
|
ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
@ -2161,6 +2161,13 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
||||||
|
|
||||||
DPRINT("NtLoadDriver('%wZ')\n", &CapturedServiceName);
|
DPRINT("NtLoadDriver('%wZ')\n", &CapturedServiceName);
|
||||||
|
|
||||||
|
/* We need a service name */
|
||||||
|
if (CapturedServiceName.Length == 0 || CapturedServiceName.Buffer == NULL)
|
||||||
|
{
|
||||||
|
ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
/* Load driver and call its entry point */
|
/* Load driver and call its entry point */
|
||||||
DriverObject = NULL;
|
DriverObject = NULL;
|
||||||
Status = IopLoadUnloadDriver(&CapturedServiceName, &DriverObject);
|
Status = IopLoadUnloadDriver(&CapturedServiceName, &DriverObject);
|
||||||
|
|
Loading…
Reference in a new issue