|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 08/17] wmi: fix annotation of AccessWmiBuffer
AccessWmiBuffer can be called with Buffer set to null, and reading it
should be protected, so we change its annotation to _In_reads_opt_.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xeniface/wmi.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index c2488f8..8e3f002 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -658,19 +658,19 @@ CompareUnicodeStrings(
static int
AccessWmiBuffer(
- _In_ PUCHAR Buffer,
- _In_ int readbuffer,
- _Out_ ULONG *RequiredSize,
- _In_ size_t BufferSize,
+ _In_reads_opt_(BufferSize) PUCHAR Buffer,
+ _In_ int readbuffer,
+ _Out_ ULONG *RequiredSize,
+ _In_ size_t BufferSize,
...
)
{
- va_list vl;
- ULONG_PTR offset;
- ULONG_PTR offby;
- PUCHAR position = Buffer;
- PUCHAR endbuffer = Buffer + BufferSize;
- int overflow = 0;
+ va_list vl;
+ ULONG_PTR offset;
+ ULONG_PTR offby;
+ PUCHAR position = Buffer;
+ PUCHAR endbuffer = Buffer + BufferSize;
+ int overflow = 0;
va_start(vl, BufferSize);
for (;;) {
--
2.55.0.windows.5
--
Césaire Mounah | Vates Windows Guest Tools Engineer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |