github / github/codeql

CodeQL Cli - false positive - Missing Dispose call on local IDisposable on MemoryStream

オープン
#7,227 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
acknowledged C# false-positive not security
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the false positive**
Error type: Missing Dispose call on local IDisposable

I ran csharp-lgtm-full.qls on my codebase. The result flag out usage of System.IO.MemoryStream class. This class implements IDisposable. However, the documentation says that MemoryStream does not hold on to any resources which needs to be disposed. (https://docs.microsoft.com/en-us/dotnet/api/system.io.memorystream?view=net-6.0)

Code that is flagged
`response.SetupProperty(r => r.Body, new MemoryStream());`

I think this class should be added to ignore list based on the MSDN documentation.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。