From 230e6b94926dd58c1105e67e0a6702cbb9c7394b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Thu, 17 Jun 2021 17:49:40 +0200 Subject: [PATCH] [NTOS:INBV] Do not ignore RtlUnicodeStringToOemString return value CORE-17637 --- ntoskrnl/inbv/inbv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index ae7ca62f6f8..78da5d5dd84 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -960,7 +960,12 @@ NtDisplayString(IN PUNICODE_STRING DisplayString) Status = STATUS_NO_MEMORY; goto Quit; } - RtlUnicodeStringToOemString(&OemString, &CapturedString, FALSE); + Status = RtlUnicodeStringToOemString(&OemString, &CapturedString, FALSE); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(OemString.Buffer, TAG_OSTR); + goto Quit; + } /* Display the string */ InbvDisplayString(OemString.Buffer);