[UDMIHELP] Initialize output buffer if DMI string is NULL
authorStanislav Motylkov <x86corez@gmail.com>
Wed, 15 Aug 2018 17:43:01 +0000 (20:43 +0300)
committerStanislav Motylkov <x86corez@gmail.com>
Sat, 29 Sep 2018 14:11:08 +0000 (17:11 +0300)
sdk/lib/udmihelp/udmihelp.c

index a7070eb..4b9695c 100644 (file)
@@ -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);