@@ -394,9 +394,10 @@ module OperationToYearAssignmentConfig implements DataFlow::ConfigSig {
394394 or
395395 n .asExpr ( ) instanceof IgnorableOperation
396396 or
397- // Hijri or Persian years are not applicable for gregorian leap year checks
397+ // Flowing into variables that indicate likely non-gregorian years are barriers
398+ // e.g., names similar to hijri, persian, lunar, chinese, etc.
398399 exists ( Variable v |
399- v .getName ( ) .toLowerCase ( ) .matches ( [ "%hijri%, %persian%" ] ) and
400+ v .getName ( ) .toLowerCase ( ) .matches ( [ "%hijri%" , " %persian%" , "%lunar%" , "%chinese %"] ) and
400401 v .getAnAccess ( ) = [ n .asIndirectExpr ( ) , n .asExpr ( ) ]
401402 )
402403 or
@@ -755,7 +756,9 @@ where
755756 not isYearModifiedWithCheck ( sink .getNode ( ) .asExpr ( ) .( YearFieldAssignment ) .getYearFieldAccess ( ) ) and
756757 not isControlledByMonthEqualityCheckNonFebruary ( sink .getNode ( ) .asExpr ( ) ) and
757758 // Check if a month is set in the same block as the year operation source
758- // to a month that would be considered safe.
759+ // and the month value would indicate its set to any other month than february.
760+ // Finds if the source year node is in the same block as a source month block
761+ // and if the same for the sinks.
759762 not exists ( DataFlow:: Node monthValSrc , DataFlow:: Node monthValSink |
760763 NonFebConstantToMonthAssignmentFlow:: flow ( monthValSrc , monthValSink ) and
761764 monthValSrc .asExpr ( ) .getBasicBlock ( ) = src .getNode ( ) .asExpr ( ) .getBasicBlock ( ) and
0 commit comments