From 6c59bd48c4d4da5f4bfbd8d569f005e476750e7b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 1 Jun 2013 20:50:13 +0000 Subject: [PATCH] [NTOS:IO] - Do not dereference an unsafe ObjectAttributes pointer in IoCreateFile. Spotted by Aleksandar Andrejevic (I'm removing the OriginalAttributes assignment completely because it's never used, and it generally makes no sense to copy this. ObOpenObjectByName already takes care of everything in attributes) CORE-7167 svn path=/trunk/; revision=59134 --- reactos/ntoskrnl/io/iomgr/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index 37a60796291..28b54262992 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -1761,7 +1761,7 @@ IoCreateFile(OUT PHANDLE FileHandle, SystemEaBuffer = ExAllocatePoolWithTag(NonPagedPool, EaLength, TAG_EA); - if(!SystemEaBuffer) + if (!SystemEaBuffer) { _SEH2_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } @@ -1840,7 +1840,6 @@ IoCreateFile(OUT PHANDLE FileHandle, RtlZeroMemory(&OpenPacket, sizeof(OPEN_PACKET)); OpenPacket.Type = IO_TYPE_OPEN_PACKET; OpenPacket.Size = sizeof(OPEN_PACKET); - OpenPacket.OriginalAttributes = *ObjectAttributes; OpenPacket.AllocationSize = SafeAllocationSize; OpenPacket.CreateOptions = CreateOptions; OpenPacket.FileAttributes = (USHORT)FileAttributes;