C#: Convert System.IO.Compression flow to CSV format.

This commit is contained in:
Michael Nebel 2021-12-14 13:37:08 +01:00
Родитель 45e416b87b
Коммит ca5c6923da
3 изменённых файлов: 15 добавлений и 18 удалений

Просмотреть файл

@ -99,6 +99,7 @@ private module Frameworks {
private import semmle.code.csharp.frameworks.system.web.ui.WebControls
private import semmle.code.csharp.frameworks.JsonNET
private import semmle.code.csharp.frameworks.system.IO
private import semmle.code.csharp.frameworks.system.io.Compression
}
/**

Просмотреть файл

@ -1779,24 +1779,6 @@ library class SystemTextEncodingFlow extends LibraryTypeDataFlow, SystemTextEnco
}
}
/** Data flow for `System.IO.Compression.DeflateStream`. */
class SystemIOCompressionDeflateStreamFlow extends LibraryTypeDataFlow,
SystemIOCompressionDeflateStream {
override predicate callableFlow(
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationCallable c,
boolean preservesValue
) {
this.constructorFlow(source, sink, c) and
preservesValue = false
}
private predicate constructorFlow(CallableFlowSource source, CallableFlowSink sink, Constructor c) {
c = this.getAMember() and
source = TCallableFlowSourceArg(0) and
sink = TCallableFlowSinkReturn()
}
}
/** Data flow for `System.Xml.XmlReader`. */
class SystemXmlXmlReaderFlow extends LibraryTypeDataFlow, SystemXmlXmlReaderClass {
override predicate callableFlow(

Просмотреть файл

@ -2,6 +2,7 @@
import csharp
private import semmle.code.csharp.frameworks.system.IO
private import semmle.code.csharp.dataflow.ExternalFlow
/** The `System.IO.Compression` namespace. */
class SystemIOCompressionNamespace extends Namespace {
@ -20,3 +21,16 @@ class SystemIOCompressionClass extends Class {
class SystemIOCompressionDeflateStream extends SystemIOCompressionClass {
SystemIOCompressionDeflateStream() { this.hasName("DeflateStream") }
}
/** Data flow for `System.IO.Compression.DeflateStream`. */
private class SystemIOCompressionDeflateStreamFlowModelCsv extends SummaryModelCsv {
override predicate row(string row) {
row =
[
"System.IO.Compression;DeflateStream;false;DeflateStream;(System.IO.Stream,System.IO.Compression.CompressionLevel);;Argument[0];ReturnValue;taint",
"System.IO.Compression;DeflateStream;false;DeflateStream;(System.IO.Stream,System.IO.Compression.CompressionLevel,System.Boolean);;Argument[0];ReturnValue;taint",
"System.IO.Compression;DeflateStream;false;DeflateStream;(System.IO.Stream,System.IO.Compression.CompressionMode);;Argument[0];ReturnValue;taint",
"System.IO.Compression;DeflateStream;false;DeflateStream;(System.IO.Stream,System.IO.Compression.CompressionMode,System.Boolean);;Argument[0];ReturnValue;taint"
]
}
}