From bae6e075e0412d0a32769aad6041c48bcf60b517 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Wed, 15 Aug 2018 20:43:01 +0300 Subject: [PATCH] [UDMIHELP] Initialize output buffer if DMI string is NULL --- sdk/lib/udmihelp/udmihelp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/lib/udmihelp/udmihelp.c b/sdk/lib/udmihelp/udmihelp.c index a7070eb33d1..4b9695c4f28 100644 --- a/sdk/lib/udmihelp/udmihelp.c +++ b/sdk/lib/udmihelp/udmihelp.c @@ -151,7 +151,13 @@ GetSMBiosStringW( SIZE_T cChars; if (!DmiString) + { + if (cchBuf >= 1) + { + *pBuf = 0; + } return 0; + } cChars = MultiByteToWideChar(CP_OEMCP, 0, DmiString, -1, pBuf, cchBuf);