File tree Expand file tree Collapse file tree
csharp/ql/src/Likely Bugs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ import semmle.code.csharp.dataflow.TaintTracking
1414
1515class UnsafeYearCreationFromArithmeticConfiguration extends TaintTracking:: Configuration {
1616 UnsafeYearCreationFromArithmeticConfiguration ( ) { this = "UnsafeYearCreationFromArithmeticConfiguration" }
17-
17+
1818 override predicate isSource ( DataFlow:: Node source ) {
19- exists ( ArithmeticOperation ao , PropertyAccess pa |
20- ao = source .asExpr ( ) |
19+ exists ( ArithmeticOperation ao , PropertyAccess pa |
20+ ao = source .asExpr ( ) |
2121 pa = ao .getAChild * ( )
2222 and pa .getProperty ( ) .getQualifiedName ( ) .matches ( "%DateTime.Year" )
2323 )
2424 }
25-
25+
2626 override predicate isSink ( DataFlow:: Node sink ) {
2727 exists ( ObjectCreation oc |
2828 sink .asExpr ( ) = oc .getArgumentForName ( "year" )
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ predicate isEraCollectionCreation(CollectionInitializer cs) {
4747 cs .getElementInitializer ( 0 ) .getValue ( ) = "1867" and
4848 cs .getElementInitializer ( 1 ) .getValue ( ) = "1911" and
4949 cs .getElementInitializer ( 2 ) .getValue ( ) = "1925" and
50- cs .getElementInitializer ( 3 ) .getValue ( ) = "1988"
50+ cs .getElementInitializer ( 3 ) .getValue ( ) = "1988"
5151}
5252
5353from Expr expr , string message
5656 isDateFromJapaneseCalendarCreation ( expr ) and message = "DateTime constructed from Japanese calendar with explicit or current era and hard-coded year" or
5757 isEraCollectionCreation ( expr ) and message = "Hard-coded collection with Japanese era years" or
5858 inEraArrayCreation ( expr ) and message = "Hard-coded array with Japanese era years" or
59- isExactEraStartDateCreation ( expr ) and message = "Hard-coded the beginning of the Japanese Heisei era"
59+ isExactEraStartDateCreation ( expr ) and message = "Hard-coded the beginning of the Japanese Heisei era"
6060select expr , message
You can’t perform that action at this time.
0 commit comments