From: Stanislav Motylkov Date: Wed, 15 Aug 2018 17:43:01 +0000 (+0300) Subject: [UDMIHELP] Initialize output buffer if DMI string is NULL X-Git-Tag: 0.4.12-dev~708 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=bae6e075e0412d0a32769aad6041c48bcf60b517 [UDMIHELP] Initialize output buffer if DMI string is NULL --- 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);