aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-09-29 15:49:47 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-10-06 05:16:14 +0000
commitb9a5dfeb26a17f719ccd81ce23790d8d586da89b (patch)
treeb468a6978e160d1b8ad7c3e59486752934543b83
parentdriver: ioctl: remove force closing of handles (diff)
downloadwireguard-nt-b9a5dfeb26a17f719ccd81ce23790d8d586da89b.tar.xz
wireguard-nt-b9a5dfeb26a17f719ccd81ce23790d8d586da89b.zip
driver: memory: help SDV with annotation
Presumably it's fighting with the _Post_nonnull_, so add an assumption statement. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--driver/memory.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/driver/memory.h b/driver/memory.h
index a51d87d..f6d8b0a 100644
--- a/driver/memory.h
+++ b/driver/memory.h
@@ -141,7 +141,9 @@ MemGetValidatedNetBufferData(_In_ CONST NET_BUFFER *Nb)
/* We intentionally neglect to add NET_BUFFER_CURRENT_MDL_OFFSET(Nb) here, as this really
* only applies to NBs that we create ourselves.
*/
- return (UCHAR *)MmGetMdlVirtualAddress(NET_BUFFER_CURRENT_MDL(Nb));
+ VOID *Addr = MmGetMdlVirtualAddress(NET_BUFFER_CURRENT_MDL(Nb));
+ _Analysis_assume_(Addr != NULL);
+ return Addr;
}
_IRQL_requires_max_(DISPATCH_LEVEL)