mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C#: Consider Enums and System.DateTimeOffset as having a sanitizing effect.
This commit is contained in:
@@ -756,6 +756,11 @@ class SystemDateTimeStruct extends SystemStruct {
|
||||
SystemDateTimeStruct() { this.hasName("DateTime") }
|
||||
}
|
||||
|
||||
/** The `System.DateTimeOffset` struct. */
|
||||
class SystemDateTimeOffsetStruct extends SystemStruct {
|
||||
SystemDateTimeOffsetStruct() { this.hasName("DateTimeOffset") }
|
||||
}
|
||||
|
||||
/** The `System.Span<T>` struct. */
|
||||
class SystemSpanStruct extends SystemUnboundGenericStruct {
|
||||
SystemSpanStruct() {
|
||||
|
||||
@@ -57,8 +57,9 @@ class SimpleTypeSanitizedExpr extends DataFlow::ExprNode {
|
||||
SimpleTypeSanitizedExpr() {
|
||||
exists(Type t | t = this.getType() or t = this.getType().(NullableType).getUnderlyingType() |
|
||||
t instanceof SimpleType or
|
||||
t instanceof SystemDateTimeStruct
|
||||
// or t instanceof Enum
|
||||
t instanceof SystemDateTimeStruct or
|
||||
t instanceof SystemDateTimeOffsetStruct or
|
||||
t instanceof Enum
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user