Skip to content

Commit 557e86b

Browse files
committed
System to Variant time and Variant to System Time auto correct leap year dates without needing to be checked.
1 parent 93eb345 commit 557e86b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,16 +538,16 @@ class TimeConversionFunction extends Function {
538538
"FileTimeToSystemTime", "SystemTimeToFileTime", "SystemTimeToTzSpecificLocalTime",
539539
"SystemTimeToTzSpecificLocalTimeEx", "TzSpecificLocalTimeToSystemTime",
540540
"TzSpecificLocalTimeToSystemTimeEx", "RtlLocalTimeToSystemTime",
541-
"RtlTimeToSecondsSince1970", "_mkgmtime", "SetSystemTime", "SystemTimeToVariantTime",
542-
"VariantTimeToSystemTime", "VarUdateFromDate", "boost::gregorian::date::from_tm"
541+
"RtlTimeToSecondsSince1970", "_mkgmtime", "SetSystemTime", "VarUdateFromDate",
542+
"boost::gregorian::date::from_tm"
543543
]
544544
or
545545
this.getQualifiedName().matches("GetDateFormat%")
546546
)
547547
or
548-
// NOTE: mktime will normalize a Feb 29 on a non-leap year to Mar 1 silently,
549548
autoLeapYearCorrecting = true and
550-
this.getQualifiedName() = ["mktime", "_mktime32", "_mktime64"]
549+
this.getQualifiedName() =
550+
["mktime", "_mktime32", "_mktime64", "SystemTimeToVariantTime", "VariantTimeToSystemTime"]
551551
}
552552

553553
/**

0 commit comments

Comments
 (0)