Fix int overflow found by vendor testing (#3406)
authorMike McLaughlin <mikem@microsoft.com>
Fri, 23 Sep 2022 03:32:47 +0000 (20:32 -0700)
committerGitHub <noreply@github.com>
Fri, 23 Sep 2022 03:32:47 +0000 (03:32 +0000)
src/SOS/SOS.Extensions/ModuleServiceFromDebuggerServices.cs

index f94977be0c66fb15d05d18513269d1b88f6cd771..fc1e61b1588f2f42a7560253ec41a9e8d760f7f3 100644 (file)
@@ -165,7 +165,7 @@ namespace SOS.Extensions
                         {
                             Trace.TraceError("GetModuleName({0}) {1:X16} FAILED {2:X8}", moduleIndex, imageBase, hr);
                         }
-                        var module = new ModuleFromDebuggerServices(this, moduleIndex, imageName, imageBase, imageSize, (uint)imageSize, timestamp);
+                        var module = new ModuleFromDebuggerServices(this, moduleIndex, imageName, imageBase, imageSize, unchecked((uint)imageSize), timestamp);
                         if (!modules.TryGetValue(imageBase, out IModule original))
                         {
                             modules.Add(imageBase, module);