[ros-dev] [ros-diffs] [hbelusca] 74493: [NTOS]: Capture the counted BaseDllName unicode string into a local NULL-terminated buffer before calling wcsrchr on it (actually I think it would be better to create & use a simi...

Thomas Faber thomas.faber at reactos.org
Sun May 7 18:49:09 UTC 2017


On 2017-05-07 20:15, hbelusca at svn.reactos.org wrote:
> --- trunk/reactos/ntoskrnl/io/iomgr/driver.c	[iso-8859-1] (original)
> +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c	[iso-8859-1] Sun May  7 18:15:12 2017
> @@ -884,7 +884,7 @@
>      PDEVICE_NODE DeviceNode;
>      PDRIVER_OBJECT DriverObject;
>      NTSTATUS Status;
> -    PWCHAR FileNameWithoutPath;
> +    PWCHAR Buffer, FileNameWithoutPath;
>      PWSTR FileExtension;
>      PUNICODE_STRING ModuleName = &BootLdrEntry->BaseDllName;
>      PLDR_DATA_TABLE_ENTRY LdrEntry;
> @@ -898,13 +898,19 @@
>      IopDisplayLoadingMessage(ModuleName);
>      InbvIndicateProgress();
>
> +    Buffer = ExAllocatePool(PagedPool, ModuleName->Length + sizeof(UNICODE_NULL));
> +    ASSERT(Buffer);

Please don't call ExAllocatePool.
And please check for allocation failure. An assert is not acceptable.



More information about the Ros-dev mailing list