Skip to content

Commit ed896eb

Browse files
authored
Add CodeQL suppression "random number" dictionary key (dotnet#4276)
1 parent 8da13c8 commit ed896eb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private SqlDependencyPerAppDomainDispatcher()
8989
#if NETFRAMEWORK
9090
_timeoutTimer = new Timer(new TimerCallback(TimeoutTimerCallback), null, Timeout.Infinite, Timeout.Infinite);
9191

92-
// If rude abort - we'll leak. This is acceptable for now.
92+
// If rude abort - we'll leak. This is acceptable for now.
9393
AppDomain.CurrentDomain.DomainUnload += new EventHandler(UnloadEventHandler);
9494
#else
9595
_timeoutTimer = ADP.UnsafeCreateTimer(
@@ -131,7 +131,7 @@ private void UnloadEventHandler(object sender, EventArgs e)
131131
}
132132
}
133133

134-
// When remoted across appdomains, MarshalByRefObject links by default time out if there is no activity
134+
// When remoted across appdomains, MarshalByRefObject links by default time out if there is no activity
135135
// within a few minutes. Add this override to prevent marshaled links from timing out.
136136
#if NET
137137
[Obsolete("InitializeLifetimeService() is not supported after .Net5.0 and throws PlatformNotSupportedException.")]
@@ -216,7 +216,7 @@ internal string AddCommandEntry(string commandHash, SqlDependency dep)
216216
dependencyList.Add(dep);
217217

218218
// map command hash to notification we just created to reuse it for the next client
219-
_commandHashToNotificationId.Add(commandHash, notificationId);
219+
_commandHashToNotificationId.Add(commandHash, notificationId); // CodeQL [SM04207] This value is an opaque query-notification correlation identifier, not a secret or security token. It is used only for uniqueness and exact dictionary lookup after SQL Server round-trips the user data. Guid.NewGuid provides sufficient collision resistance for the expected in-process notification cardinality, and changing the generator would not materially improve security.
220220
_notificationIdToDependenciesHash.Add(notificationId, dependencyList);
221221
}
222222

0 commit comments

Comments
 (0)