Bug 1558561: Fix missing population of RTL_OSVERSIONINFOW::dwOSVersionInfoSize; r=mhowell, a=jcristau
authorAaron Klotz <aklotz@mozilla.com>
Tue, 11 Jun 2019 17:19:37 +0000
changeset 536929 807e9d8f83dc8b87a5e1c76061f63fac179010d0
parent 536928 f8429b9c6790161fa215e5d340ba05eae544c6de
child 536930 1f82fe365272472c28fb2c988ce6124bdec1fd7c
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell, jcristau
bugs1558561
milestone68.0
Bug 1558561: Fix missing population of RTL_OSVERSIONINFOW::dwOSVersionInfoSize; r=mhowell, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D34559
browser/app/winlauncher/DllBlocklistWin.cpp
--- a/browser/app/winlauncher/DllBlocklistWin.cpp
+++ b/browser/app/winlauncher/DllBlocklistWin.cpp
@@ -8,24 +8,27 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ImportDir.h"
 #include "mozilla/NativeNt.h"
 #include "mozilla/Types.h"
 #include "mozilla/WindowsDllBlocklist.h"
 #include "mozilla/WinHeaderOnlyUtils.h"
 
+// clang-format off
 #define MOZ_LITERAL_UNICODE_STRING(s)                                        \
   {                                                                          \
     /* Length of the string in bytes, less the null terminator */            \
-    sizeof(s) - sizeof(wchar_t), /* Length of the string in bytes, including \
-                                    the null terminator */                   \
-        sizeof(s),               /* Pointer to the buffer */                 \
-        const_cast<wchar_t*>(s)                                              \
+    sizeof(s) - sizeof(wchar_t),                                             \
+    /* Length of the string in bytes, including the null terminator */       \
+    sizeof(s),                                                               \
+    /* Pointer to the buffer */                                              \
+    const_cast<wchar_t*>(s)                                                  \
   }
+// clang-format on
 
 #define DLL_BLOCKLIST_ENTRY(name, ...) \
   {MOZ_LITERAL_UNICODE_STRING(L##name), __VA_ARGS__},
 #define DLL_BLOCKLIST_STRING_TYPE UNICODE_STRING
 
 #if defined(MOZ_LAUNCHER_PROCESS) || defined(NIGHTLY_BUILD)
 #  include "mozilla/WindowsDllBlocklistDefs.h"
 #else
@@ -162,17 +165,17 @@ extern "C" void MOZ_EXPORT NativeNtBlock
 }
 
 static bool CheckBlockInfo(const DllBlockInfo* aInfo, void* aBaseAddress,
                            uint64_t& aVersion) {
   aVersion = ALL_VERSIONS;
 
   if (aInfo->flags &
       (DllBlockInfo::BLOCK_WIN8PLUS_ONLY | DllBlockInfo::BLOCK_WIN8_ONLY)) {
-    RTL_OSVERSIONINFOW osv;
+    RTL_OSVERSIONINFOW osv = {sizeof(osv)};
     NTSTATUS ntStatus = ::RtlGetVersion(&osv);
     if (!NT_SUCCESS(ntStatus)) {
       // huh?
       return false;
     }
 
     if (osv.dwMajorVersion < 8) {
       return true;