https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52fe43e87b1f5f5423b34…
commit 52fe43e87b1f5f5423b34fd96d524a1d85142867
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Nov 28 09:56:03 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Tue Dec 13 07:18:24 2022 +0100
[KMTEST] Add a NULL check
---
modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c
b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c
index 89bc3973cfb..0270ff1d5e2 100644
--- a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c
@@ -459,6 +459,11 @@ TestIrpHandler(
ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was
allocated!\n");
OrigBuffer = Buffer = MapAndLockUserBuffer(Irp, Length);
ok(Buffer != NULL, "Null pointer!\n");
+ if (Buffer == NULL)
+ {
+ Status = STATUS_UNSUCCESSFUL;
+ goto Exit;
+ }
if (Offset.QuadPart < Fcb->Header.FileSize.QuadPart)
{
@@ -545,6 +550,7 @@ TestIrpHandler(
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
+Exit:
FsRtlExitFileSystem();
return Status;