Index: FileTextLines.cpp

===================================================================

--- FileTextLines.cpp	(revision 22779)

+++ FileTextLines.cpp	(working copy)

@@ -230,7 +230,10 @@

     // If new[] was done for type T delete[] must be called on a pointer of type T*,
     // otherwise the behavior is undefined.
     // +1 is to address possible truncation when integer division is done
-    wchar_t* pFileBuf = new wchar_t[fsize.LowPart/sizeof(wchar_t) + 1];
+	const size_t fileBufCharCount = fsize.LowPart/sizeof(wchar_t) + 1;
+    wchar_t* pFileBuf = new wchar_t[fileBufCharCount];
+	memset(pFileBuf, 0, fileBufCharCount * sizeof(wchar_t));
+
     DWORD dwReadBytes = 0;
     if (!ReadFile(hFile, pFileBuf, fsize.LowPart, &dwReadBytes, NULL))
     {

