mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
C#: Convert System.Boolean flow to CSV format.
This commit is contained in:
@@ -499,37 +499,6 @@ private module FrameworkDataFlowAdaptor {
|
||||
}
|
||||
}
|
||||
|
||||
/** Data flow for `System.Boolean`. */
|
||||
class SystemBooleanFlow extends LibraryTypeDataFlow, SystemBooleanStruct {
|
||||
override predicate callableFlow(
|
||||
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationCallable c,
|
||||
boolean preservesValue
|
||||
) {
|
||||
this.methodFlow(source, sink, c) and
|
||||
preservesValue = false
|
||||
}
|
||||
|
||||
private predicate methodFlow(
|
||||
CallableFlowSource source, CallableFlowSink sink, SourceDeclarationMethod m
|
||||
) {
|
||||
m = this.getParseMethod() and
|
||||
(
|
||||
source = TCallableFlowSourceArg(0) and
|
||||
sink = TCallableFlowSinkReturn()
|
||||
)
|
||||
or
|
||||
m = this.getTryParseMethod() and
|
||||
(
|
||||
source = TCallableFlowSourceArg(0) and
|
||||
(
|
||||
sink = TCallableFlowSinkReturn()
|
||||
or
|
||||
sink = TCallableFlowSinkArg(any(int i | m.getParameter(i).isOutOrRef()))
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** Data flow for `System.Uri`. */
|
||||
class SystemUriFlow extends LibraryTypeDataFlow, SystemUriClass {
|
||||
override predicate callableFlow(
|
||||
|
||||
@@ -92,6 +92,18 @@ class SystemBooleanStruct extends BoolType {
|
||||
}
|
||||
}
|
||||
|
||||
/** Data flow for `System.Boolean` */
|
||||
private class SystemBoolean32FlowModelCsv extends SummaryModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
"System;Boolean;false;Parse;(System.String);;Argument[0];ReturnValue;taint",
|
||||
"System;Boolean;false;TryParse;(System.String,System.Boolean);;Argument[0];Argument[1];taint",
|
||||
"System;Boolean;false;TryParse;(System.String,System.Boolean);;Argument[0];ReturnValue;taint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/** The `System.Convert` class. */
|
||||
class SystemConvertClass extends SystemClass {
|
||||
SystemConvertClass() { this.hasName("Convert") }
|
||||
|
||||
Reference in New Issue
Block a user