From 8e7b22a631d8602dc7c6167ec33cb7938e210bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Bi=C8=99oc?= Date: Sat, 22 Apr 2023 17:18:57 +0200 Subject: [PATCH] [NTOS:OB] Fix the SAL2 annotation of ObQueryTypeInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The data has to be written into ObjectTypeInfo based on the return length, not only what is provided by the input buffer length. Fix suggested by Hermès. --- ntoskrnl/ob/oblife.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ob/oblife.c b/ntoskrnl/ob/oblife.c index f0ae6aafee3..10f010cea49 100644 --- a/ntoskrnl/ob/oblife.c +++ b/ntoskrnl/ob/oblife.c @@ -946,7 +946,8 @@ NTSTATUS NTAPI ObQueryTypeInfo( _In_ POBJECT_TYPE ObjectType, - _Out_writes_bytes_(Length) POBJECT_TYPE_INFORMATION ObjectTypeInfo, + _Out_writes_bytes_to_(Length, *ReturnLength) + POBJECT_TYPE_INFORMATION ObjectTypeInfo, _In_ ULONG Length, _Out_ PULONG ReturnLength) {