https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95c340dfb770e6b8c48cd…
commit 95c340dfb770e6b8c48cd522d029a8dddcaaffb9
Author: Thamatip Chitpong <thamatip.chitpong(a)reactos.org>
AuthorDate: Fri Aug 30 07:34:48 2024 +0700
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Aug 30 07:34:48 2024 +0700
[NTOS:CC] CcRosCreateVacb: Return error code on pool allocation failure (#7275)
Return STATUS_INSUFFICIENT_RESOURCES error code instead of accessing the invalid
pointer.
---
ntoskrnl/cc/view.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 7c13afb3220..f35d5c227c2 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -812,6 +812,10 @@ CcRosCreateVacb (
DPRINT("CcRosCreateVacb()\n");
current = ExAllocateFromNPagedLookasideList(&VacbLookasideList);
+ if (!current)
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
current->BaseAddress = NULL;
current->Dirty = FALSE;
current->PageOut = FALSE;