Skip to content

Commit 7604938

Browse files
committed
Added more heuristic ignorable functions.
1 parent a8d5357 commit 7604938

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ class IgnorableFunction extends Function {
6767
this.getName().toLowerCase().matches("%persian%")
6868
or
6969
this.getFile().getBaseName().toLowerCase().matches("%persian%")
70+
or
71+
// misc. from string/char converters heuristic
72+
this.getName()
73+
.toLowerCase()
74+
.matches(["%char%to%", "%string%to%", "%from%char%", "%from%string%"])
7075
}
7176
}
7277

@@ -730,5 +735,6 @@ where
730735
dayOrMonthValSrc.asExpr().getValue().toInt() <= 27
731736
)
732737
)
738+
// TODO: all days to sink are safe?
733739
select sink, src, sink,
734740
"Year field has been modified, but no appropriate check for LeapYear was found."

0 commit comments

Comments
 (0)