Skip to content

Commit 66d3986

Browse files
Copilotbrianrob
andcommitted
Improve security check handling for STA exception case
Co-authored-by: brianrob <[email protected]>
1 parent 62c6a31 commit 66d3986

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/TraceEvent/Symbols/SymbolReader.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,20 @@ private bool PdbMatches(string filePath, Guid pdbGuid, int pdbAge, bool checkSec
913913
{
914914
fileExists = true;
915915

916-
if (checkSecurity && !CheckSecurity(filePath))
916+
if (checkSecurity)
917917
{
918-
m_log.WriteLine("FindSymbolFilePath: Aborting, security check failed on {0}", filePath);
919-
return false;
918+
if (!CheckSecurity(filePath))
919+
{
920+
m_log.WriteLine("FindSymbolFilePath: Aborting, security check failed on {0}", filePath);
921+
return false;
922+
}
923+
securityCheckPassed = true;
924+
}
925+
else
926+
{
927+
// Security check not required, so it's implicitly passed
928+
securityCheckPassed = true;
920929
}
921-
922-
securityCheckPassed = true;
923930

924931
if (pdbGuid == Guid.Empty)
925932
{

0 commit comments

Comments
 (0)