diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-09-29 15:49:47 +0000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-06 05:16:14 +0000 |
commit | b9a5dfeb26a17f719ccd81ce23790d8d586da89b (patch) | |
tree | b468a6978e160d1b8ad7c3e59486752934543b83 | |
parent | driver: ioctl: remove force closing of handles (diff) | |
download | wireguard-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.h | 4 |
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) |