We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb72602 commit c94edcfCopy full SHA for c94edcf
1 file changed
cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp
@@ -1052,4 +1052,20 @@ ATime_HrGetSysTime(SYSTEMTIME *pst)
1052
// pst->wMinute = static_cast<WORD>(m_lMinute);
1053
// pst->wSecond = static_cast<WORD>(m_lSecond);
1054
// pst->wMilliseconds = 0;
1055
+}
1056
+
1057
+/**
1058
+* Negative Case - Anti-pattern 1: [year ±n, month, day]
1059
+* Modification of SYSTEMTIME struct by copying from another struct, but no arithmetic is performed.
1060
+*/
1061
+void fp_daymonth_guard(){
1062
+ SYSTEMTIME st;
1063
+ FILETIME ft;
1064
+ GetSystemTime(&st);
1065
1066
+ st.wYear++;
1067
1068
+ st.wDay = st.wMonth == 2 && st.wDay == 29 ? 28 : st.wDay;
1069
1070
+ SystemTimeToFileTime(&st, &ft);
1071
}
0 commit comments