Skip to content

Commit df3fcfc

Browse files
committed
Changing the name of a predicate to be more precise.
1 parent e2d3d15 commit df3fcfc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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
@@ -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
*/
530530
class 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
}

cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
)

0 commit comments

Comments
 (0)