File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
cpp/ql/src/Likely Bugs/Leap Year Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -528,10 +528,10 @@ class SafeTimeGatheringFunction extends Function {
528528 * This list of APIs should check for the return value to detect problems during the conversion.
529529 */
530530class TimeConversionFunction extends Function {
531- boolean autoConverts ;
531+ boolean autoLeapYearCorrecting ;
532532
533533 TimeConversionFunction ( ) {
534- autoConverts = false and
534+ autoLeapYearCorrecting = false and
535535 (
536536 this .getQualifiedName ( ) =
537537 [
@@ -546,12 +546,12 @@ class TimeConversionFunction extends Function {
546546 )
547547 or
548548 // NOTE: mktime will normalize a Feb 29 on a non-leap year to Mar 1 silently,
549- autoConverts = true and
549+ autoLeapYearCorrecting = true and
550550 this .getQualifiedName ( ) = [ "mktime" , "_mktime32" , "_mktime64" ]
551551 }
552552
553553 /**
554554 * Holds if the function is expected to auto convert a bad leap year date.
555555 */
556- predicate isAutoConverting ( ) { autoConverts = true }
556+ predicate isAutoLeapYearCorrecting ( ) { autoLeapYearCorrecting = true }
557557}
Original file line number Diff line number Diff line change @@ -520,7 +520,7 @@ module YearAssignmentToCheckedTimeConversionConfig implements DataFlow::StateCon
520520 or
521521 state in [ true , false ] and
522522 exists ( Call c , TimeConversionFunction f |
523- f .isAutoConverting ( ) and
523+ f .isAutoLeapYearCorrecting ( ) and
524524 c .getTarget ( ) = f and
525525 c .getAnArgument ( ) .getAChild * ( ) = [ sink .asExpr ( ) , sink .asIndirectExpr ( ) ]
526526 )
You can’t perform that action at this time.
0 commit comments