CodeQL Cli - false positive - Missing Dispose call on local IDisposable on MemoryStream
未關閉
acknowledged
C#
false-positive
not security
- 主要語言
- CodeQL
- 星號
- 10.1k
- 分支
- 2.1k
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 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 還沒有評估資料。