diff --git a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected index 4896657bbe6a..41ef6df5ce34 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected +++ b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/UncheckedLeapYearAfterYearModification.expected @@ -141,47 +141,3 @@ nodes | test.cpp:1697:2:1697:22 | ... += ... | semmle.label | ... += ... | | test.cpp:1773:2:1773:22 | ... += ... | semmle.label | ... += ... | subpaths -testFailures -| test.cpp:422:2:422:14 | ... += ... | Unexpected result: Alert | -| test.cpp:440:2:440:11 | ... ++ | Unexpected result: Alert | -| test.cpp:456:2:456:12 | ... ++ | Unexpected result: Alert | -| test.cpp:681:2:681:23 | ... += ... | Unexpected result: Alert | -| test.cpp:813:2:813:40 | ... = ... | Unexpected result: Alert | -| test.cpp:813:21:813:40 | ... + ... | Unexpected result: Alert | -| test.cpp:818:2:818:24 | ... = ... | Unexpected result: Alert | -| test.cpp:818:13:818:24 | ... + ... | Unexpected result: Alert | -| test.cpp:951:3:951:25 | ... = ... | Unexpected result: Alert | -| test.cpp:951:14:951:25 | ... + ... | Unexpected result: Alert | -| test.cpp:969:3:969:12 | ... ++ | Unexpected result: Alert | -| test.cpp:1051:2:1051:11 | ... ++ | Unexpected result: Alert | -| test.cpp:1071:16:1071:23 | increment_arg output argument | Unexpected result: Alert | -| test.cpp:1075:27:1075:35 | increment_arg_by_pointer output argument | Unexpected result: Alert | -| test.cpp:1129:2:1129:26 | ... = ... | Unexpected result: Alert | -| test.cpp:1129:14:1129:26 | ... - ... | Unexpected result: Alert | -| test.cpp:1180:2:1180:19 | ... = ... | Unexpected result: Alert | -| test.cpp:1219:2:1219:28 | ... = ... | Unexpected result: Alert | -| test.cpp:1219:16:1219:28 | ... + ... | Unexpected result: Alert | -| test.cpp:1234:2:1234:28 | ... = ... | Unexpected result: Alert | -| test.cpp:1234:16:1234:28 | ... + ... | Unexpected result: Alert | -| test.cpp:1248:2:1248:28 | ... = ... | Unexpected result: Alert | -| test.cpp:1248:16:1248:28 | ... + ... | Unexpected result: Alert | -| test.cpp:1262:2:1262:26 | ... = ... | Unexpected result: Alert | -| test.cpp:1262:14:1262:26 | ... + ... | Unexpected result: Alert | -| test.cpp:1276:2:1276:26 | ... = ... | Unexpected result: Alert | -| test.cpp:1276:14:1276:26 | ... + ... | Unexpected result: Alert | -| test.cpp:1282:2:1282:28 | ... = ... | Unexpected result: Alert | -| test.cpp:1282:16:1282:28 | ... + ... | Unexpected result: Alert | -| test.cpp:1294:2:1294:28 | ... = ... | Unexpected result: Alert | -| test.cpp:1294:16:1294:28 | ... + ... | Unexpected result: Alert | -| test.cpp:1307:2:1307:26 | ... = ... | Unexpected result: Alert | -| test.cpp:1307:14:1307:26 | ... + ... | Unexpected result: Alert | -| test.cpp:1319:2:1319:26 | ... = ... | Unexpected result: Alert | -| test.cpp:1319:14:1319:26 | ... + ... | Unexpected result: Alert | -| test.cpp:1361:2:1361:17 | ... = ... | Unexpected result: Alert | -| test.cpp:1535:2:1535:15 | ... = ... | Unexpected result: Alert | -| test.cpp:1565:2:1565:22 | ... += ... | Unexpected result: Alert | -| test.cpp:1573:2:1573:22 | ... += ... | Unexpected result: Alert | -| test.cpp:1652:2:1652:22 | ... += ... | Unexpected result: Alert | -| test.cpp:1664:2:1664:22 | ... += ... | Unexpected result: Alert | -| test.cpp:1697:2:1697:22 | ... += ... | Unexpected result: Alert | -| test.cpp:1773:2:1773:22 | ... += ... | Unexpected result: Alert | diff --git a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp index d8c3d0595a63..3331b17bd880 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp +++ b/cpp/ql/test/query-tests/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification/test.cpp @@ -419,10 +419,10 @@ void AntiPattern_unchecked_filetime_conversion2a() GetSystemTime(&st); // BUG - UncheckedLeapYearAfterYearModification - st.wYear += 2; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear += 2; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // BUG - UncheckedReturnValueForTimeFunctions - SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } /** @@ -437,10 +437,10 @@ void AntiPattern_unchecked_filetime_conversion2b() GetSystemTime(&st); // BUG - UncheckedLeapYearAfterYearModification - st.wYear++; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear++; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // BUG - UncheckedReturnValueForTimeFunctions - SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } /** @@ -453,10 +453,10 @@ void AntiPattern_unchecked_filetime_conversion2b(SYSTEMTIME* st) FILETIME ft; // BUG - UncheckedLeapYearAfterYearModification - st->wYear++; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st->wYear++; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // BUG - UncheckedReturnValueForTimeFunctions - SystemTimeToFileTime(st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } /** @@ -678,7 +678,7 @@ void AntiPattern_IncorrectGuard(int yearsToAdd) GetSystemTime(&st); // BUG - UncheckedLeapYearAfterYearModification - st.wYear += yearsToAdd; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear += yearsToAdd; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // Incorrect Guard if (st.wMonth == 2 && st.wDay == 29) @@ -810,12 +810,12 @@ void test(int x) // BUG - UncheckedLeapYearAfterYearModification // Positive Case - Anti-pattern 1: [year +-n, month, day] - timeinfo.tm_year = x + timeinfo.tm_year; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year = x + timeinfo.tm_year; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] st.wYear = x; // BUG - UncheckedLeapYearAfterYearModification // Positive Case - Anti-pattern 1: [year +-n, month, day] - st.wYear = x + st.wYear; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear = x + st.wYear; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } /** @@ -948,9 +948,9 @@ void tp_intermediaryVar(struct timespec now, struct logtime ×tamp_remote) GetSystemTime(&st); // BUG - UncheckedLeapYearAfterYearModification - st.wYear = st.wYear + 1; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear = st.wYear + 1; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] - SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } /** @@ -966,9 +966,9 @@ void tp_intermediaryVar(struct timespec now, struct logtime ×tamp_remote) GetSystemTime(&st); // BUG - UncheckedLeapYearAfterYearModification - st.wYear++; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear++; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] - SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } /** @@ -1048,11 +1048,11 @@ void fp_daymonth_guard(){ // FALSE POSITIVE: year is incremented but month is checked and day corrected // in a ternary operation. It may be possible to fix this with a more sophisticated // data flow analysis. - st.wYear++; // $ SPURIOUS: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + st.wYear++; // $ SPURIOUS: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] st.wDay = st.wMonth == 2 && st.wDay == 29 ? 28 : st.wDay; - SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/leap-year/unchecked-return-value-for-time-conversion-function] + SystemTimeToFileTime(&st, &ft); // $ Alert[cpp/microsoft/public/leap-year/unchecked-return-value-for-time-conversion-function] } void increment_arg(WORD &x){ @@ -1068,11 +1068,11 @@ void fn_year_set_through_out_arg(){ SYSTEMTIME st; GetSystemTime(&st); // BAD, year incremented without check - increment_arg(st.wYear); // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + increment_arg(st.wYear); // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // GetSystemTime(&st); // Bad, year incremented without check - increment_arg_by_pointer(&st.wYear); // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + increment_arg_by_pointer(&st.wYear); // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1126,7 +1126,7 @@ typedef struct _TIME_FIELDS { void tp_ptime(PTIME_FIELDS ptm){ - ptm->Year = ptm->Year - 1; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + ptm->Year = ptm->Year - 1; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1177,7 +1177,7 @@ void leap_year_checked_raw_false_positive2(WORD year, WORD offset, WORD day){ year += offset; // $ Source - tmp.tm_year = year; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1216,7 +1216,7 @@ void inverted_leap_year_check(WORD year, WORD offset, WORD day){ day = 28; } - tmp.tm_year = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1231,7 +1231,7 @@ void simplified_leap_year_check1(WORD year, WORD offset){ } // Modified after check, could be dangerous - tmp.tm_year = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void simplified_leap_year_check2(WORD year, WORD offset){ @@ -1245,7 +1245,7 @@ void simplified_leap_year_check2(WORD year, WORD offset){ } // Modified after check, could be dangerous - tmp.tm_year = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void simplified_leap_year_check3(WORD year, WORD offset){ @@ -1259,7 +1259,7 @@ void simplified_leap_year_check3(WORD year, WORD offset){ } // Modified after check, could be dangerous - tmp.wYear = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.wYear = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void simplified_leap_year_check4(WORD year, WORD offset){ @@ -1273,13 +1273,13 @@ void simplified_leap_year_check4(WORD year, WORD offset){ } // Modified after check, could be dangerous - tmp.wYear = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.wYear = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void bad_simplified_leap_year_check1(WORD year, WORD offset){ struct tm tmp; - tmp.tm_year = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // incorrect logic, should negate the %4 result bool isLeap = ((tmp.tm_year + 1900) % 4) && ((tmp.tm_year + 1900) % 100 || !((tmp.tm_year + 1900) % 400)); @@ -1291,7 +1291,7 @@ void bad_simplified_leap_year_check1(WORD year, WORD offset){ void bad_simplified_leap_year_check2(WORD year, WORD offset){ struct tm tmp; - tmp.tm_year = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.tm_year = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // incorrect logic, should not negate the %4 result @@ -1304,7 +1304,7 @@ void bad_simplified_leap_year_check2(WORD year, WORD offset){ void bad_simplified_leap_year_check3(WORD year, WORD offset){ SYSTEMTIME tmp; - tmp.wYear = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.wYear = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // incorrect logic, should negate the %4 result bool isLeap = (tmp.wYear % 4) && (tmp.wYear % 100 || !(tmp.wYear % 400)); @@ -1316,7 +1316,7 @@ void bad_simplified_leap_year_check3(WORD year, WORD offset){ void bad_simplified_leap_year_check4(WORD year, WORD offset){ SYSTEMTIME tmp; - tmp.wYear = year + offset; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.wYear = year + offset; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // incorrect logic, should not negate the %4 result @@ -1358,7 +1358,7 @@ void indirect_time_conversion_check(WORD year, WORD offset){ void set_time(WORD year, WORD month, WORD day){ SYSTEMTIME tmp; - tmp.wYear = year; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + tmp.wYear = year; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] tmp.wMonth = month; tmp.wDay = day; } @@ -1492,7 +1492,7 @@ void modification_after_conversion1(tm timeinfo){ // and never reassigned to another struct. WORD year = timeinfo.tm_year + 1900; - year += 1; // $ MISSING: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + year += 1; // $ MISSING: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } WORD get_civil_year(tm timeinfo){ @@ -1504,7 +1504,7 @@ void modification_after_conversion2(tm timeinfo){ // This case shows a false negative where the year might be used and it is incorrectly modified, // and never reassigned to another struct. WORD year = get_civil_year(timeinfo); - year += 1; // $ MISSING: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + year += 1; // $ MISSING: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void modification_after_conversion_saved_to_other_time_struct1(tm timeinfo){ @@ -1518,7 +1518,7 @@ void modification_after_conversion_saved_to_other_time_struct1(tm timeinfo){ SYSTEMTIME s; // FALSE NEGATIVE: missing this because the conversion happens locally before // the year adjustment, which seems as though it is part of a conversion itself - s.wYear = year; // $ MISSING: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + s.wYear = year; // $ MISSING: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1532,7 +1532,7 @@ void modification_after_conversion_saved_to_other_time_struct2(tm timeinfo){ year += 1; // $ Source SYSTEMTIME s; - s.wYear = year; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + s.wYear = year; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void modification_after_conversion_saved_to_other_time_struct3(tm timeinfo){ @@ -1546,7 +1546,7 @@ void modification_after_conversion_saved_to_other_time_struct3(tm timeinfo){ SYSTEMTIME s; // FALSE NEGATIVE: missing this because the conversion happens locally before // the year adjustment, which seems as though it is part of a conversion itself - s.wYear = year; // $ MISSING: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + s.wYear = year; // $ MISSING: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } @@ -1558,11 +1558,11 @@ void year_saved_to_variable_then_modified1(tm timeinfo){ // NOTE: should we even try to detect cases like this? // Our current rationale is that a year in a struct is more dangerous than a year in isolation // A year in isolation is harder to interpret - year += 1; // MISSING: $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + year += 1; // MISSING: $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] } void modification_before_conversion1(tm timeinfo){ - timeinfo.tm_year += 1; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // convert a tm year into a civil year, then modify after conversion // This case shows a false negative where the year might be used and it is incorrectly modified, // and never reassigned to another struct. @@ -1570,7 +1570,7 @@ void modification_before_conversion1(tm timeinfo){ } void modification_before_conversion2(tm timeinfo){ - timeinfo.tm_year += 1; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // convert a tm year into a civil year, then modify after conversion // This case shows a false negative where the year might be used and it is incorrectly modified, // and never reassigned to another struct. @@ -1649,7 +1649,7 @@ void odd_leap_year_check1(tm timeinfo){ } void odd_leap_year_check2(tm timeinfo){ - timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // Using an odd sytle of checking divisible by 4 presumably as an optimization trick // but also check unrelated conditions on the year as an optimization to rule out irrelevant years @@ -1661,7 +1661,7 @@ void odd_leap_year_check2(tm timeinfo){ } void odd_leap_year_check3(tm timeinfo){ - timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // Using an odd sytle of checking divisible by 4 presumably as an optimization trick // but also check unrelated conditions on the year as an optimization to rule out irrelevant years @@ -1694,7 +1694,7 @@ void odd_leap_year_check5(tm timeinfo){ void date_adjusted_through_mkgmtime(tm timeinfo){ - timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ SPURIOUS: Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] // Using an odd sytle of checking divisible by 4 presumably as an optimization trick // but also check unrelated conditions on the year as an optimization to rule out irrelevant years @@ -1770,7 +1770,7 @@ void assumed_maketime_conversion1(tm timeinfo) void bad_leap_year_check_logic1(tm timeinfo){ - timeinfo.tm_year += 1; // $ Alert[cpp/leap-year/unchecked-after-arithmetic-year-modification] + timeinfo.tm_year += 1; // $ Alert[cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification] WORD year = get_civil_year(timeinfo); diff --git a/powershell/ql/lib/semmle/code/powershell/dataflow/flowsources/Local.qll b/powershell/ql/lib/semmle/code/powershell/dataflow/flowsources/Local.qll index 4ffff2d35c62..b3a7fd66b433 100644 --- a/powershell/ql/lib/semmle/code/powershell/dataflow/flowsources/Local.qll +++ b/powershell/ql/lib/semmle/code/powershell/dataflow/flowsources/Local.qll @@ -59,7 +59,11 @@ private class ExternalCommandLineArgumentSource extends CommandLineArgumentSourc * A data flow source that represents the parameters of the `Main` method of a program. */ private class MainMethodArgumentSource extends CommandLineArgumentSource { - MainMethodArgumentSource() { this.asParameter().getFunction() instanceof TopLevelFunction } + MainMethodArgumentSource() { + this.asParameter().getFunction() instanceof TopLevelFunction and + not this.asParameter() instanceof PipelineParameter and + not this.asParameter() instanceof PipelineByPropertyNameParameter + } } /** diff --git a/powershell/ql/test/library-tests/frameworks/system_net_sockets/test.expected b/powershell/ql/test/library-tests/frameworks/system_net_sockets/test.expected index 4a55f3a35549..e69de29bb2d1 100644 --- a/powershell/ql/test/library-tests/frameworks/system_net_sockets/test.expected +++ b/powershell/ql/test/library-tests/frameworks/system_net_sockets/test.expected @@ -1 +0,0 @@ -| test.ps1:1:1:43:0 | [synth] pipeline | Unexpected result: type="command line argument" | diff --git a/python/ql/test/library-tests/dataflow/fieldflow/UnresolvedCalls.expected b/python/ql/test/library-tests/dataflow/fieldflow/UnresolvedCalls.expected index 593b6e118874..e69de29bb2d1 100644 --- a/python/ql/test/library-tests/dataflow/fieldflow/UnresolvedCalls.expected +++ b/python/ql/test/library-tests/dataflow/fieldflow/UnresolvedCalls.expected @@ -1,4 +0,0 @@ -| test.py:4:17:4:60 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) | -| test.py:4:33:4:59 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) | -| test_dict.py:4:17:4:60 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) | -| test_dict.py:4:33:4:59 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) | diff --git a/python/ql/test/library-tests/dataflow/fieldflow/test.py b/python/ql/test/library-tests/dataflow/fieldflow/test.py index f0152ad38a84..26551392b281 100644 --- a/python/ql/test/library-tests/dataflow/fieldflow/test.py +++ b/python/ql/test/library-tests/dataflow/fieldflow/test.py @@ -1,7 +1,7 @@ import sys import os -sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) +sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) unresolved_call=os.path.dirname(..) unresolved_call=os.path.dirname(..) from testlib import expects # These are defined so that we can evaluate the test code. diff --git a/python/ql/test/library-tests/dataflow/fieldflow/test_dict.py b/python/ql/test/library-tests/dataflow/fieldflow/test_dict.py index f64a5187925d..e49d9ed2a8ce 100644 --- a/python/ql/test/library-tests/dataflow/fieldflow/test_dict.py +++ b/python/ql/test/library-tests/dataflow/fieldflow/test_dict.py @@ -1,7 +1,7 @@ import sys import os -sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) +sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) unresolved_call=os.path.dirname(..) unresolved_call=os.path.dirname(..) from testlib import expects # These are defined so that we can evaluate the test code.