From a10f6c7a0ce2b311027f4460063a25db5ff3b094 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 20 May 2018 13:53:11 +0200 Subject: [PATCH] [FASTFAT] Fail if allocating the stream FO fails. --- drivers/filesystems/fastfat/dirwr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/filesystems/fastfat/dirwr.c b/drivers/filesystems/fastfat/dirwr.c index cffc7af031f..ab5d9b3ee4d 100644 --- a/drivers/filesystems/fastfat/dirwr.c +++ b/drivers/filesystems/fastfat/dirwr.c @@ -47,6 +47,11 @@ vfatFCBInitializeCacheFromVolume( } fileObject = IoCreateStreamFileObject (NULL, vcb->StorageDevice); + if (fileObject == NULL) + { + status = STATUS_INSUFFICIENT_RESOURCES; + goto Quit; + } #ifdef KDBG if (DebugFile.Buffer != NULL && FsRtlIsNameInExpression(&DebugFile, &fcb->LongNameU, FALSE, NULL))