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);