From 9dbc18f51e1d8b3827420718acdf1c4c932f30b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:09:37 +0000 Subject: [PATCH 1/2] chore(deps): Bump Microsoft.CodeAnalysis.NetAnalyzers in /src Bumps [Microsoft.CodeAnalysis.NetAnalyzers](https://github.com/dotnet/roslyn-analyzers) from 8.0.0 to 9.0.0. - [Release notes](https://github.com/dotnet/roslyn-analyzers/releases) - [Changelog](https://github.com/dotnet/roslyn-analyzers/blob/main/PostReleaseActivities.md) - [Commits](https://github.com/dotnet/roslyn-analyzers/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.NetAnalyzers dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build/NetFrameworkRelease.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NetFrameworkRelease.targets b/build/NetFrameworkRelease.targets index 2d59f6848..10496641b 100644 --- a/build/NetFrameworkRelease.targets +++ b/build/NetFrameworkRelease.targets @@ -29,7 +29,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 5092d526d1b0006ddabb6bc5bd41567c72dde8b0 Mon Sep 17 00:00:00 2001 From: v-sharmachir Date: Tue, 10 Dec 2024 16:42:51 +0530 Subject: [PATCH 2/2] adding fix for CA2022 --- .../Highlighting/Win32SnapshotButton.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/AccessibilityInsights.SharedUx/Highlighting/Win32SnapshotButton.cs b/src/AccessibilityInsights.SharedUx/Highlighting/Win32SnapshotButton.cs index 03f48337a..c8da06a02 100644 --- a/src/AccessibilityInsights.SharedUx/Highlighting/Win32SnapshotButton.cs +++ b/src/AccessibilityInsights.SharedUx/Highlighting/Win32SnapshotButton.cs @@ -104,7 +104,16 @@ private static PrivateFontCollection LoadFontResource() try { byte[] fontdata = new byte[fontStream.Length]; - fontStream.Read(fontdata, 0, (int)fontStream.Length); + int bytesRead = 0; + while (bytesRead < fontdata.Length) + { + int read = fontStream.Read(fontdata, bytesRead, fontdata.Length - bytesRead); + if (read <= 0) + { + throw new EndOfStreamException("Unexpected end of stream"); + } + bytesRead += read; + } Marshal.Copy(fontdata, 0, data, (int)fontStream.Length); fonts.AddMemoryFont(data, (int)fontStream.Length); }