diff --git a/c/cert/src/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql b/c/cert/src/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql index 635d9d5c03..39e15c7ad3 100644 --- a/c/cert/src/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql +++ b/c/cert/src/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql @@ -18,7 +18,7 @@ import cpp import codingstandards.c.cert -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import NonArrayPointerToArrayIndexingExprFlow::PathGraph /** diff --git a/c/cert/src/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.ql b/c/cert/src/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.ql index c3ebd6ede6..18631f579a 100644 --- a/c/cert/src/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.ql +++ b/c/cert/src/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert import codingstandards.cpp.types.Pointers -import semmle.code.cpp.dataflow.TaintTracking +import semmle.code.cpp.dataflow.new.TaintTracking import ScaledIntegerPointerArithmeticFlow::PathGraph /** @@ -61,9 +61,11 @@ class ScaledIntegerExpr extends Expr { ScaledIntegerExpr() { not this.getParent*() instanceof ArrayCountOfExpr and ( - this.(SizeofExprOperator).getExprOperand().getType().getSize() > 1 + exists(this.getValue()) and + this.getAChild*().(SizeofExprOperator).getExprOperand().getType().getSize() > 1 or - this.(SizeofTypeOperator).getTypeOperand().getSize() > 1 + exists(this.getValue()) and + this.getAChild*().(SizeofTypeOperator).getTypeOperand().getSize() > 1 or this instanceof OffsetOfExpr ) diff --git a/c/cert/src/rules/CON30-C/CleanUpThreadSpecificStorage.ql b/c/cert/src/rules/CON30-C/CleanUpThreadSpecificStorage.ql index 1e03c089e8..afa664448a 100644 --- a/c/cert/src/rules/CON30-C/CleanUpThreadSpecificStorage.ql +++ b/c/cert/src/rules/CON30-C/CleanUpThreadSpecificStorage.ql @@ -19,8 +19,8 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency -import semmle.code.cpp.dataflow.DataFlow +import codingstandards.cpp.ConcurrencyNew +import semmle.code.cpp.dataflow.new.DataFlow module TssCreateToTssDeleteConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node node) { diff --git a/c/cert/src/rules/CON33-C/RaceConditionsWhenUsingLibraryFunctions.ql b/c/cert/src/rules/CON33-C/RaceConditionsWhenUsingLibraryFunctions.ql index c9bcaa6bd2..dadb21985e 100644 --- a/c/cert/src/rules/CON33-C/RaceConditionsWhenUsingLibraryFunctions.ql +++ b/c/cert/src/rules/CON33-C/RaceConditionsWhenUsingLibraryFunctions.ql @@ -18,7 +18,7 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from ThreadedCFN node where diff --git a/c/cert/src/rules/CON34-C/AppropriateThreadObjectStorageDurations.ql b/c/cert/src/rules/CON34-C/AppropriateThreadObjectStorageDurations.ql index 4fb034406b..10cdec5c73 100644 --- a/c/cert/src/rules/CON34-C/AppropriateThreadObjectStorageDurations.ql +++ b/c/cert/src/rules/CON34-C/AppropriateThreadObjectStorageDurations.ql @@ -20,8 +20,8 @@ import cpp import codingstandards.c.cert import codingstandards.c.Objects -import codingstandards.cpp.Concurrency -import semmle.code.cpp.dataflow.DataFlow +import codingstandards.cpp.ConcurrencyNew +import semmle.code.cpp.dataflow.new.DataFlow import semmle.code.cpp.commons.Alloc from C11ThreadCreateCall tcc, Expr arg @@ -53,6 +53,7 @@ where not exists(TSSSetFunctionCall tss, DataFlow::Node src | // there should be dataflow from somewhere (the same somewhere) // into each of the first arguments + exists(Expr e | e = src.asDefinition() or e = src.asDefiningArgument()) and DataFlow::localFlow(src, DataFlow::exprNode(tsg.getArgument(0))) and DataFlow::localFlow(src, DataFlow::exprNode(tss.getArgument(0))) ) diff --git a/c/cert/src/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.ql b/c/cert/src/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.ql index 07b114d6ca..40acc1e3ea 100644 --- a/c/cert/src/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.ql +++ b/c/cert/src/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.ql @@ -20,8 +20,8 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency -import semmle.code.cpp.dataflow.DataFlow +import codingstandards.cpp.ConcurrencyNew +import semmle.code.cpp.dataflow.new.DataFlow from TSSGetFunctionCall tsg, ThreadedFunction tf where @@ -31,7 +31,8 @@ where // however, there does not exist a proper sequencing. not exists(TSSSetFunctionCall tss, DataFlow::Node src | // there should be dataflow from somewhere (the same somewhere) - // into each of the first arguments + // into each of the first argument + exists(Expr e | e = src.asDefinition() or e = src.asDefiningArgument()) and DataFlow::localFlow(src, DataFlow::exprNode(tsg.getArgument(0))) and DataFlow::localFlow(src, DataFlow::exprNode(tss.getArgument(0))) ) diff --git a/c/cert/src/rules/CON37-C/DoNotCallSignalInMultithreadedProgram.ql b/c/cert/src/rules/CON37-C/DoNotCallSignalInMultithreadedProgram.ql index 17691f24dd..72fe5b5923 100644 --- a/c/cert/src/rules/CON37-C/DoNotCallSignalInMultithreadedProgram.ql +++ b/c/cert/src/rules/CON37-C/DoNotCallSignalInMultithreadedProgram.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from FunctionCall fc // This should only be applied in the context of a multi-threaded program (since diff --git a/c/cert/src/rules/CON40-C/AtomicVariableTwiceInExpression.ql b/c/cert/src/rules/CON40-C/AtomicVariableTwiceInExpression.ql index 0ec195868f..cc85cd9d1c 100644 --- a/c/cert/src/rules/CON40-C/AtomicVariableTwiceInExpression.ql +++ b/c/cert/src/rules/CON40-C/AtomicVariableTwiceInExpression.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from MacroInvocation mi, Variable v, Locatable whereFound where diff --git a/c/cert/src/rules/CON41-C/WrapFunctionsThatCanFailSpuriouslyInLoop.ql b/c/cert/src/rules/CON41-C/WrapFunctionsThatCanFailSpuriouslyInLoop.ql index 57be1bc488..d7754973fe 100644 --- a/c/cert/src/rules/CON41-C/WrapFunctionsThatCanFailSpuriouslyInLoop.ql +++ b/c/cert/src/rules/CON41-C/WrapFunctionsThatCanFailSpuriouslyInLoop.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from AtomicCompareExchange ace where diff --git a/c/cert/src/rules/ERR30-C/ErrnoReadBeforeReturn.ql b/c/cert/src/rules/ERR30-C/ErrnoReadBeforeReturn.ql index 13f7e40303..bea6ae3ec8 100644 --- a/c/cert/src/rules/ERR30-C/ErrnoReadBeforeReturn.ql +++ b/c/cert/src/rules/ERR30-C/ErrnoReadBeforeReturn.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert import codingstandards.c.Errno -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow /** * A call to an `OutOfBandErrnoSettingFunction` diff --git a/c/cert/src/rules/ERR30-C/SetlocaleMightSetErrno.ql b/c/cert/src/rules/ERR30-C/SetlocaleMightSetErrno.ql index a7ccf8c041..eaecf29a85 100644 --- a/c/cert/src/rules/ERR30-C/SetlocaleMightSetErrno.ql +++ b/c/cert/src/rules/ERR30-C/SetlocaleMightSetErrno.ql @@ -18,7 +18,7 @@ import cpp import codingstandards.c.cert import codingstandards.c.Errno -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow class SetlocaleFunctionCall extends FunctionCall { SetlocaleFunctionCall() { this.getTarget().hasGlobalName("setlocale") } diff --git a/c/cert/src/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.ql b/c/cert/src/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.ql index 0d294e48b1..7b428a7eee 100644 --- a/c/cert/src/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.ql +++ b/c/cert/src/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert import codingstandards.cpp.Alignment -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis import ExprWithAlignmentToCStyleCastFlow::PathGraph diff --git a/c/cert/src/rules/FIO37-C/SuccessfulFgetsOrFgetwsMayReturnAnEmptyString.ql b/c/cert/src/rules/FIO37-C/SuccessfulFgetsOrFgetwsMayReturnAnEmptyString.ql index ad3a2c8192..d9b96d3c86 100644 --- a/c/cert/src/rules/FIO37-C/SuccessfulFgetsOrFgetwsMayReturnAnEmptyString.ql +++ b/c/cert/src/rules/FIO37-C/SuccessfulFgetsOrFgetwsMayReturnAnEmptyString.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert import codingstandards.cpp.FgetsErrorManagement import codingstandards.cpp.Dereferenced -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow /* * CFG nodes that follows a successful call to `fgets` diff --git a/c/cert/src/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.ql b/c/cert/src/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.ql index 9b0882ac66..b853adba99 100644 --- a/c/cert/src/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.ql +++ b/c/cert/src/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.ql @@ -21,7 +21,7 @@ import cpp import codingstandards.cpp.FgetsErrorManagement import codingstandards.cpp.Dereferenced import codingstandards.c.cert -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow /* * Models calls to `memcpy` `strcpy` `strncpy` and their wrappers diff --git a/c/cert/src/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.ql b/c/cert/src/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.ql index 85369b502e..0500294b9b 100644 --- a/c/cert/src/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.ql +++ b/c/cert/src/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert import codingstandards.cpp.standardlibrary.FileAccess -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import semmle.code.cpp.valuenumbering.GlobalValueNumbering /** diff --git a/c/cert/src/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.ql b/c/cert/src/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.ql index 67fa83e852..6342bcbd68 100644 --- a/c/cert/src/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.ql +++ b/c/cert/src/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.c.cert -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow /** * The argument of a call to `asctime` @@ -29,6 +29,8 @@ class AsctimeArg extends Expr { this = any(FunctionCall f | f.getTarget().hasGlobalName(["asctime", "asctime_r"])).getArgument(0) } + + DataFlow::Node asSink() { this = result.asIndirectExpr() } } /** @@ -37,13 +39,13 @@ class AsctimeArg extends Expr { */ module TmStructSafeConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node src) { - src.asExpr() + src.asIndirectExpr() .(FunctionCall) .getTarget() .hasGlobalName(["localtime", "localtime_r", "localtime_s", "gmtime", "gmtime_r", "gmtime_s"]) } - predicate isSink(DataFlow::Node sink) { sink.asExpr() instanceof AsctimeArg } + predicate isSink(DataFlow::Node sink) { exists(AsctimeArg arg | arg.asSink() = sink) } } module TmStructSafeFlow = DataFlow::Global; @@ -51,6 +53,6 @@ module TmStructSafeFlow = DataFlow::Global; from AsctimeArg fc where not isExcluded(fc, Contracts7Package::doNotPassInvalidDataToTheAsctimeFunctionQuery()) and - not TmStructSafeFlow::flowToExpr(fc) + not TmStructSafeFlow::flowTo(fc.asSink()) select fc, "The function `asctime` and `asctime_r` should be discouraged. Unsanitized input can overflow the output buffer." diff --git a/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected b/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected index fb0074e0e6..adabbcf759 100644 --- a/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected +++ b/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected @@ -1,22 +1,21 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql:28,60-68) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql:29,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql:41,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql:49,26-34) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnNonArrayObjectPointers.ql:70,3-11) edges -| test.c:14:38:14:39 | p1 | test.c:18:10:18:11 | v1 | provenance | | -| test.c:14:38:14:39 | p1 | test.c:19:10:19:11 | v2 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:16:13:16:14 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:17:13:17:14 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:20:10:20:11 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:21:10:21:11 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:22:9:22:10 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:23:13:23:14 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:24:9:24:10 | p1 | provenance | | | test.c:14:38:14:39 | p1 | test.c:25:9:25:10 | p1 | provenance | | +| test.c:16:13:16:14 | p1 | test.c:18:10:18:13 | ... ++ | provenance | | +| test.c:17:13:17:14 | p1 | test.c:19:10:19:13 | ... -- | provenance | | | test.c:51:30:51:38 | & ... | test.c:14:38:14:39 | p1 | provenance | | nodes | test.c:14:38:14:39 | p1 | semmle.label | p1 | -| test.c:18:10:18:11 | v1 | semmle.label | v1 | -| test.c:19:10:19:11 | v2 | semmle.label | v2 | +| test.c:16:13:16:14 | p1 | semmle.label | p1 | +| test.c:17:13:17:14 | p1 | semmle.label | p1 | +| test.c:18:10:18:13 | ... ++ | semmle.label | ... ++ | +| test.c:19:10:19:13 | ... -- | semmle.label | ... -- | | test.c:20:10:20:11 | p1 | semmle.label | p1 | | test.c:21:10:21:11 | p1 | semmle.label | p1 | | test.c:22:9:22:10 | p1 | semmle.label | p1 | @@ -32,8 +31,8 @@ nodes | test.c:51:30:51:38 | & ... | semmle.label | & ... | subpaths #select -| test.c:18:10:18:11 | v1 | test.c:51:30:51:38 | & ... | test.c:18:10:18:11 | v1 | Pointer arithmetic on non-array object pointer. | -| test.c:19:10:19:11 | v2 | test.c:51:30:51:38 | & ... | test.c:19:10:19:11 | v2 | Pointer arithmetic on non-array object pointer. | +| test.c:18:10:18:13 | ... ++ | test.c:51:30:51:38 | & ... | test.c:18:10:18:13 | ... ++ | Pointer arithmetic on non-array object pointer. | +| test.c:19:10:19:13 | ... -- | test.c:51:30:51:38 | & ... | test.c:19:10:19:13 | ... -- | Pointer arithmetic on non-array object pointer. | | test.c:20:10:20:11 | p1 | test.c:51:30:51:38 | & ... | test.c:20:10:20:11 | p1 | Pointer arithmetic on non-array object pointer. | | test.c:21:10:21:11 | p1 | test.c:51:30:51:38 | & ... | test.c:21:10:21:11 | p1 | Pointer arithmetic on non-array object pointer. | | test.c:22:9:22:10 | p1 | test.c:51:30:51:38 | & ... | test.c:22:9:22:10 | p1 | Pointer arithmetic on non-array object pointer. | diff --git a/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected b/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected index 0a6471deac..7a7f740547 100644 --- a/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected +++ b/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected @@ -1,22 +1,22 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotAddOrSubtractAScaledIntegerToAPointer.ql:77,56-64) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotAddOrSubtractAScaledIntegerToAPointer.ql:78,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotAddOrSubtractAScaledIntegerToAPointer.ql:80,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotAddOrSubtractAScaledIntegerToAPointer.ql:89,45-53) edges | test.c:7:13:7:14 | p1 | test.c:9:9:9:10 | p1 | provenance | | +| test.c:16:19:16:41 | ... - ... | test.c:16:19:16:41 | ... - ... | provenance | | | test.c:16:19:16:41 | ... - ... | test.c:18:26:18:31 | offset | provenance | | | test.c:16:19:16:41 | ... - ... | test.c:29:6:29:11 | offset | provenance | | +| test.c:17:17:17:26 | sizeof() | test.c:17:17:17:26 | sizeof() | provenance | | | test.c:17:17:17:26 | sizeof() | test.c:23:9:23:12 | size | provenance | | | test.c:29:6:29:11 | offset | test.c:7:13:7:14 | p1 | provenance | | nodes | test.c:7:13:7:14 | p1 | semmle.label | p1 | | test.c:9:9:9:10 | p1 | semmle.label | p1 | | test.c:16:19:16:41 | ... - ... | semmle.label | ... - ... | +| test.c:16:19:16:41 | ... - ... | semmle.label | ... - ... | +| test.c:17:17:17:26 | sizeof() | semmle.label | sizeof() | | test.c:17:17:17:26 | sizeof() | semmle.label | sizeof() | | test.c:18:26:18:31 | offset | semmle.label | offset | | test.c:23:9:23:12 | size | semmle.label | size | | test.c:25:9:25:18 | sizeof() | semmle.label | sizeof() | -| test.c:27:17:27:26 | sizeof() | semmle.label | sizeof() | +| test.c:27:12:27:26 | ... / ... | semmle.label | ... / ... | | test.c:29:6:29:11 | offset | semmle.label | offset | subpaths #select @@ -24,4 +24,4 @@ subpaths | test.c:18:26:18:31 | offset | test.c:16:19:16:41 | ... - ... | test.c:18:26:18:31 | offset | Scaled integer used in pointer arithmetic. | | test.c:23:9:23:12 | size | test.c:17:17:17:26 | sizeof() | test.c:23:9:23:12 | size | Scaled integer used in pointer arithmetic. | | test.c:25:9:25:18 | sizeof() | test.c:25:9:25:18 | sizeof() | test.c:25:9:25:18 | sizeof() | Scaled integer used in pointer arithmetic. | -| test.c:27:17:27:26 | sizeof() | test.c:27:17:27:26 | sizeof() | test.c:27:17:27:26 | sizeof() | Scaled integer used in pointer arithmetic. | +| test.c:27:12:27:26 | ... / ... | test.c:27:12:27:26 | ... / ... | test.c:27:12:27:26 | ... / ... | Scaled integer used in pointer arithmetic. | diff --git a/c/cert/test/rules/CON30-C/CleanUpThreadSpecificStorage.expected b/c/cert/test/rules/CON30-C/CleanUpThreadSpecificStorage.expected index f3ea87136a..e03b665a1c 100644 --- a/c/cert/test/rules/CON30-C/CleanUpThreadSpecificStorage.expected +++ b/c/cert/test/rules/CON30-C/CleanUpThreadSpecificStorage.expected @@ -1,9 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:25,46-54) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:26,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:35,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:45,35-43) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:53,36-44) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CleanUpThreadSpecificStorage.ql:55,36-44) | test.c:27:3:27:12 | call to tss_create | Resources used by thread specific storage may not be cleaned up. | | test.c:49:3:49:12 | call to tss_create | Resources used by thread specific storage may not be cleaned up. | | test.c:71:3:71:12 | call to tss_create | Resources used by thread specific storage may not be cleaned up. | diff --git a/c/cert/test/rules/CON34-C/AppropriateThreadObjectStorageDurations.expected b/c/cert/test/rules/CON34-C/AppropriateThreadObjectStorageDurations.expected index 2cd844f81b..c3cdc8bd7b 100644 --- a/c/cert/test/rules/CON34-C/AppropriateThreadObjectStorageDurations.expected +++ b/c/cert/test/rules/CON34-C/AppropriateThreadObjectStorageDurations.expected @@ -1,16 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:35,14-22) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:37,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:39,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:42,45-53) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:52,33-41) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:52,58-66) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:53,42-50) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:56,9-17) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:56,34-42) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:57,9-17) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:57,34-42) -WARNING: module 'TaintTracking' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:42,9-22) -WARNING: module 'TaintTracking' has been deprecated and may be removed in future (AppropriateThreadObjectStorageDurations.ql:52,7-20) | test.c:23:3:23:13 | call to thrd_create | $@ not declared with appropriate storage duration | test.c:23:24:23:29 | & ... | Shared object | | test.c:74:3:74:13 | call to thrd_create | $@ not declared with appropriate storage duration | test.c:74:24:74:24 | p | Shared object | | test.c:85:3:85:13 | call to thrd_create | $@ not declared with appropriate storage duration | test.c:85:24:85:24 | p | Shared object | diff --git a/c/cert/test/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.expected b/c/cert/test/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.expected index b2ac853fbf..95d0a20041 100644 --- a/c/cert/test/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.expected +++ b/c/cert/test/rules/CON34-C/ThreadObjectStorageDurationsNotInitialized.expected @@ -1,6 +1 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ThreadObjectStorageDurationsNotInitialized.ql:32,38-46) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ThreadObjectStorageDurationsNotInitialized.ql:35,5-13) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ThreadObjectStorageDurationsNotInitialized.ql:35,30-38) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ThreadObjectStorageDurationsNotInitialized.ql:36,5-13) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ThreadObjectStorageDurationsNotInitialized.ql:36,30-38) | test.c:14:7:14:13 | call to tss_get | Call to a thread specific storage function from within a threaded context on an object that may not be owned by this thread. | diff --git a/c/cert/test/rules/ERR30-C/ErrnoReadBeforeReturn.expected b/c/cert/test/rules/ERR30-C/ErrnoReadBeforeReturn.expected index 125f55118b..b6d7caa513 100644 --- a/c/cert/test/rules/ERR30-C/ErrnoReadBeforeReturn.expected +++ b/c/cert/test/rules/ERR30-C/ErrnoReadBeforeReturn.expected @@ -1,4 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ErrnoReadBeforeReturn.ql:46,7-15) | test.c:69:7:69:11 | * ... | Do not read `errno` before checking the return value of function $@. | test.c:68:3:68:7 | call to ftell | call to ftell | | test.c:69:7:69:11 | call to __errno_location | Do not read `errno` before checking the return value of function $@. | test.c:68:3:68:7 | call to ftell | call to ftell | | test.c:70:5:70:10 | call to perror | Do not read `errno` before checking the return value of function $@. | test.c:68:3:68:7 | call to ftell | call to ftell | diff --git a/c/cert/test/rules/ERR30-C/SetlocaleMightSetErrno.expected b/c/cert/test/rules/ERR30-C/SetlocaleMightSetErrno.expected index 20a7ff60b1..9ab88a3395 100644 --- a/c/cert/test/rules/ERR30-C/SetlocaleMightSetErrno.expected +++ b/c/cert/test/rules/ERR30-C/SetlocaleMightSetErrno.expected @@ -1,3 +1,2 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (SetlocaleMightSetErrno.ql:70,7-15) | test.c:98:3:98:11 | call to setlocale | Do not read `errno` before checking the return value of a call to `setlocale`. | | test.c:104:7:104:15 | call to setlocale | The value of `errno` may be different than `0` when `setlocale` is called. The following `errno` check might be invalid. | diff --git a/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected b/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected index eb7642ae28..381f2b053c 100644 --- a/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected +++ b/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected @@ -1,277 +1,290 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:103,86-94) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:125,3-11) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:127,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:132,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:138,3-11) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:144,55-63) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:145,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:147,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:154,26-34) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotCastPointerToMoreStrictlyAlignedPointerType.ql:169,44-52) edges -| test.c:75:14:75:16 | & ... | test.c:76:11:76:12 | v1 | provenance | | -| test.c:75:14:75:16 | & ... | test.c:77:12:77:13 | v1 | provenance | | -| test.c:75:14:75:16 | & ... | test.c:78:10:78:11 | v1 | provenance | | -| test.c:75:14:75:16 | & ... | test.c:79:12:79:13 | v1 | provenance | | -| test.c:75:14:75:16 | & ... | test.c:80:11:80:12 | v1 | provenance | | -| test.c:75:14:75:16 | & ... | test.c:81:13:81:14 | v1 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:85:11:85:12 | v2 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:86:12:86:13 | v2 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:87:10:87:11 | v2 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:88:12:88:13 | v2 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:89:11:89:12 | v2 | provenance | | -| test.c:84:14:84:16 | & ... | test.c:90:13:90:14 | v2 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:94:11:94:12 | v3 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:95:12:95:13 | v3 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:96:10:96:11 | v3 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:97:12:97:13 | v3 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:98:11:98:12 | v3 | provenance | | -| test.c:93:14:93:16 | & ... | test.c:99:13:99:14 | v3 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:103:11:103:12 | v4 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:104:12:104:13 | v4 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:105:10:105:11 | v4 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:106:12:106:13 | v4 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:107:11:107:12 | v4 | provenance | | -| test.c:102:14:102:16 | & ... | test.c:108:13:108:14 | v4 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:112:11:112:12 | v5 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:113:12:113:13 | v5 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:114:10:114:11 | v5 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:115:12:115:13 | v5 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:116:11:116:12 | v5 | provenance | | -| test.c:111:14:111:16 | & ... | test.c:117:13:117:14 | v5 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:121:11:121:12 | v6 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:122:12:122:13 | v6 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:123:10:123:11 | v6 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:124:12:124:13 | v6 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:125:11:125:12 | v6 | provenance | | -| test.c:120:14:120:16 | & ... | test.c:126:13:126:14 | v6 | provenance | | -| test.c:129:22:129:22 | v | test.c:130:17:130:17 | v | provenance | | -| test.c:135:21:135:23 | & ... | test.c:129:22:129:22 | v | provenance | | -| test.c:138:21:138:23 | & ... | test.c:129:22:129:22 | v | provenance | | -| test.c:166:24:166:29 | call to malloc | test.c:167:13:167:15 | & ... | provenance | | -| test.c:166:24:166:29 | call to malloc | test.c:168:16:168:17 | s1 | provenance | | -| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | -| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:75:14:75:16 | & ... | provenance | | +| test.c:75:14:75:16 | & ... | test.c:76:3:76:12 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:77:3:77:13 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:78:3:78:11 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:79:3:79:13 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:80:3:80:12 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:81:3:81:14 | v1 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:84:14:84:16 | & ... | provenance | | +| test.c:84:14:84:16 | & ... | test.c:85:3:85:12 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:86:3:86:13 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:87:3:87:11 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:88:3:88:13 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:89:3:89:12 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:90:3:90:14 | v2 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:93:14:93:16 | & ... | provenance | | +| test.c:93:14:93:16 | & ... | test.c:94:3:94:12 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:95:3:95:13 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:96:3:96:11 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:97:3:97:13 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:98:3:98:12 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:99:3:99:14 | v3 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:102:14:102:16 | & ... | provenance | | +| test.c:102:14:102:16 | & ... | test.c:103:3:103:12 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:104:3:104:13 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:105:3:105:11 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:106:3:106:13 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:107:3:107:12 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:108:3:108:14 | v4 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:111:14:111:16 | & ... | provenance | | +| test.c:111:14:111:16 | & ... | test.c:112:3:112:12 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:113:3:113:13 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:114:3:114:11 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:115:3:115:13 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:116:3:116:12 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:117:3:117:14 | v5 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:120:14:120:16 | & ... | provenance | | +| test.c:120:14:120:16 | & ... | test.c:121:3:121:12 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:122:3:122:13 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:123:3:123:11 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:124:3:124:13 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:125:3:125:12 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:126:3:126:14 | v6 | provenance | | +| test.c:129:22:129:22 | v | test.c:130:10:130:17 | v | provenance | | +| test.c:135:13:135:23 | & ... | test.c:129:22:129:22 | v | provenance | | +| test.c:138:13:138:23 | & ... | test.c:129:22:129:22 | v | provenance | | +| test.c:166:15:166:33 | call to malloc | test.c:166:15:166:33 | call to malloc | provenance | | +| test.c:166:15:166:33 | call to malloc | test.c:168:3:168:17 | s1 | provenance | | +| test.c:166:15:166:33 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | +| test.c:166:15:166:33 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | | test.c:169:13:169:14 | s1 | test.c:129:22:129:22 | v | provenance | | | test.c:174:13:174:14 | s2 | test.c:129:22:129:22 | v | provenance | | | test.c:179:13:179:14 | s3 | test.c:129:22:129:22 | v | provenance | | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:184:11:184:12 | v1 | provenance | | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:185:10:185:11 | v1 | provenance | | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:186:13:186:14 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:183:14:183:26 | call to aligned_alloc | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:184:3:184:12 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:185:3:185:11 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:186:3:186:14 | v1 | provenance | | | test.c:183:14:183:26 | call to aligned_alloc | test.c:187:13:187:14 | v1 | provenance | | | test.c:187:13:187:14 | v1 | test.c:129:22:129:22 | v | provenance | | +| test.c:189:14:189:26 | call to aligned_alloc | test.c:189:14:189:26 | call to aligned_alloc | provenance | | | test.c:189:14:189:26 | call to aligned_alloc | test.c:190:13:190:14 | v2 | provenance | | | test.c:190:13:190:14 | v2 | test.c:129:22:129:22 | v | provenance | | -| test.c:222:8:222:9 | p2 | test.c:223:11:223:12 | v1 | provenance | | -| test.c:222:8:222:9 | p2 | test.c:224:12:224:13 | v1 | provenance | | -| test.c:222:8:222:9 | p2 | test.c:225:10:225:11 | v1 | provenance | | -| test.c:222:8:222:9 | p2 | test.c:226:12:226:13 | v1 | provenance | | -| test.c:222:8:222:9 | p2 | test.c:227:11:227:12 | v1 | provenance | | -| test.c:222:8:222:9 | p2 | test.c:228:13:228:14 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:223:3:223:12 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:224:3:224:13 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:225:3:225:11 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:226:3:226:13 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:227:3:227:12 | v1 | provenance | | +| test.c:222:3:222:9 | ... = ... | test.c:228:3:228:14 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:222:3:222:9 | ... = ... | provenance | | +| test.c:238:13:238:14 | & ... | test.c:238:13:238:14 | & ... | provenance | | | test.c:238:13:238:14 | & ... | test.c:244:12:244:13 | ip | provenance | | -| test.c:241:15:241:18 | & ... | test.c:247:9:247:12 | & ... | provenance | | -| test.c:252:16:252:18 | & ... | test.c:254:11:254:13 | ps1 | provenance | | -| test.c:252:16:252:18 | & ... | test.c:256:10:256:12 | ps1 | provenance | | +| test.c:240:16:240:19 | & ... | test.c:246:9:246:12 | & ... | provenance | | +| test.c:252:16:252:18 | & ... | test.c:252:16:252:18 | & ... | provenance | | +| test.c:252:16:252:18 | & ... | test.c:254:3:254:13 | ps1 | provenance | | +| test.c:252:16:252:18 | & ... | test.c:256:3:256:12 | ps1 | provenance | | nodes -| test.c:7:11:7:13 | & ... | semmle.label | & ... | -| test.c:8:12:8:14 | & ... | semmle.label | & ... | -| test.c:9:10:9:12 | & ... | semmle.label | & ... | -| test.c:10:11:10:13 | & ... | semmle.label | & ... | -| test.c:11:12:11:14 | & ... | semmle.label | & ... | -| test.c:12:13:12:15 | & ... | semmle.label | & ... | -| test.c:15:11:15:13 | & ... | semmle.label | & ... | -| test.c:16:12:16:14 | & ... | semmle.label | & ... | -| test.c:17:10:17:12 | & ... | semmle.label | & ... | -| test.c:18:11:18:13 | & ... | semmle.label | & ... | -| test.c:19:12:19:14 | & ... | semmle.label | & ... | -| test.c:20:13:20:15 | & ... | semmle.label | & ... | -| test.c:23:11:23:13 | & ... | semmle.label | & ... | -| test.c:24:12:24:14 | & ... | semmle.label | & ... | -| test.c:25:10:25:12 | & ... | semmle.label | & ... | -| test.c:26:12:26:14 | & ... | semmle.label | & ... | -| test.c:27:11:27:13 | & ... | semmle.label | & ... | -| test.c:28:13:28:15 | & ... | semmle.label | & ... | -| test.c:31:11:31:13 | & ... | semmle.label | & ... | -| test.c:32:12:32:14 | & ... | semmle.label | & ... | -| test.c:33:10:33:12 | & ... | semmle.label | & ... | -| test.c:34:12:34:14 | & ... | semmle.label | & ... | -| test.c:35:11:35:13 | & ... | semmle.label | & ... | -| test.c:36:13:36:15 | & ... | semmle.label | & ... | -| test.c:39:11:39:13 | & ... | semmle.label | & ... | -| test.c:40:12:40:14 | & ... | semmle.label | & ... | -| test.c:41:10:41:12 | & ... | semmle.label | & ... | -| test.c:42:12:42:14 | & ... | semmle.label | & ... | -| test.c:43:11:43:13 | & ... | semmle.label | & ... | -| test.c:44:13:44:15 | & ... | semmle.label | & ... | -| test.c:47:11:47:13 | & ... | semmle.label | & ... | -| test.c:48:12:48:14 | & ... | semmle.label | & ... | -| test.c:49:10:49:12 | & ... | semmle.label | & ... | -| test.c:50:12:50:14 | & ... | semmle.label | & ... | -| test.c:51:11:51:13 | & ... | semmle.label | & ... | -| test.c:52:13:52:15 | & ... | semmle.label | & ... | -| test.c:57:11:57:13 | & ... | semmle.label | & ... | -| test.c:58:12:58:14 | & ... | semmle.label | & ... | -| test.c:59:10:59:12 | & ... | semmle.label | & ... | -| test.c:60:12:60:14 | & ... | semmle.label | & ... | -| test.c:61:11:61:13 | & ... | semmle.label | & ... | -| test.c:62:13:62:15 | & ... | semmle.label | & ... | -| test.c:65:11:65:13 | & ... | semmle.label | & ... | -| test.c:66:12:66:14 | & ... | semmle.label | & ... | -| test.c:67:10:67:12 | & ... | semmle.label | & ... | -| test.c:68:12:68:14 | & ... | semmle.label | & ... | -| test.c:69:11:69:13 | & ... | semmle.label | & ... | -| test.c:70:13:70:15 | & ... | semmle.label | & ... | +| test.c:7:3:7:13 | & ... | semmle.label | & ... | +| test.c:8:3:8:14 | & ... | semmle.label | & ... | +| test.c:9:3:9:12 | & ... | semmle.label | & ... | +| test.c:10:3:10:13 | & ... | semmle.label | & ... | +| test.c:11:3:11:14 | & ... | semmle.label | & ... | +| test.c:12:3:12:15 | & ... | semmle.label | & ... | +| test.c:15:3:15:13 | & ... | semmle.label | & ... | +| test.c:16:3:16:14 | & ... | semmle.label | & ... | +| test.c:17:3:17:12 | & ... | semmle.label | & ... | +| test.c:18:3:18:13 | & ... | semmle.label | & ... | +| test.c:19:3:19:14 | & ... | semmle.label | & ... | +| test.c:20:3:20:15 | & ... | semmle.label | & ... | +| test.c:23:3:23:13 | & ... | semmle.label | & ... | +| test.c:24:3:24:14 | & ... | semmle.label | & ... | +| test.c:25:3:25:12 | & ... | semmle.label | & ... | +| test.c:26:3:26:14 | & ... | semmle.label | & ... | +| test.c:27:3:27:13 | & ... | semmle.label | & ... | +| test.c:28:3:28:15 | & ... | semmle.label | & ... | +| test.c:31:3:31:13 | & ... | semmle.label | & ... | +| test.c:32:3:32:14 | & ... | semmle.label | & ... | +| test.c:33:3:33:12 | & ... | semmle.label | & ... | +| test.c:34:3:34:14 | & ... | semmle.label | & ... | +| test.c:35:3:35:13 | & ... | semmle.label | & ... | +| test.c:36:3:36:15 | & ... | semmle.label | & ... | +| test.c:39:3:39:13 | & ... | semmle.label | & ... | +| test.c:40:3:40:14 | & ... | semmle.label | & ... | +| test.c:41:3:41:12 | & ... | semmle.label | & ... | +| test.c:42:3:42:14 | & ... | semmle.label | & ... | +| test.c:43:3:43:13 | & ... | semmle.label | & ... | +| test.c:44:3:44:15 | & ... | semmle.label | & ... | +| test.c:47:3:47:13 | & ... | semmle.label | & ... | +| test.c:48:3:48:14 | & ... | semmle.label | & ... | +| test.c:49:3:49:12 | & ... | semmle.label | & ... | +| test.c:50:3:50:14 | & ... | semmle.label | & ... | +| test.c:51:3:51:13 | & ... | semmle.label | & ... | +| test.c:52:3:52:15 | & ... | semmle.label | & ... | +| test.c:57:3:57:13 | & ... | semmle.label | & ... | +| test.c:58:3:58:14 | & ... | semmle.label | & ... | +| test.c:59:3:59:12 | & ... | semmle.label | & ... | +| test.c:60:3:60:14 | & ... | semmle.label | & ... | +| test.c:61:3:61:13 | & ... | semmle.label | & ... | +| test.c:62:3:62:15 | & ... | semmle.label | & ... | +| test.c:65:3:65:13 | & ... | semmle.label | & ... | +| test.c:66:3:66:14 | & ... | semmle.label | & ... | +| test.c:67:3:67:12 | & ... | semmle.label | & ... | +| test.c:68:3:68:14 | & ... | semmle.label | & ... | +| test.c:69:3:69:13 | & ... | semmle.label | & ... | +| test.c:70:3:70:15 | & ... | semmle.label | & ... | | test.c:75:14:75:16 | & ... | semmle.label | & ... | | test.c:75:14:75:16 | & ... | semmle.label | & ... | -| test.c:76:11:76:12 | v1 | semmle.label | v1 | -| test.c:77:12:77:13 | v1 | semmle.label | v1 | -| test.c:78:10:78:11 | v1 | semmle.label | v1 | -| test.c:79:12:79:13 | v1 | semmle.label | v1 | -| test.c:80:11:80:12 | v1 | semmle.label | v1 | -| test.c:81:13:81:14 | v1 | semmle.label | v1 | +| test.c:75:14:75:16 | & ... | semmle.label | & ... | +| test.c:76:3:76:12 | v1 | semmle.label | v1 | +| test.c:77:3:77:13 | v1 | semmle.label | v1 | +| test.c:78:3:78:11 | v1 | semmle.label | v1 | +| test.c:79:3:79:13 | v1 | semmle.label | v1 | +| test.c:80:3:80:12 | v1 | semmle.label | v1 | +| test.c:81:3:81:14 | v1 | semmle.label | v1 | +| test.c:84:14:84:16 | & ... | semmle.label | & ... | | test.c:84:14:84:16 | & ... | semmle.label | & ... | | test.c:84:14:84:16 | & ... | semmle.label | & ... | -| test.c:85:11:85:12 | v2 | semmle.label | v2 | -| test.c:86:12:86:13 | v2 | semmle.label | v2 | -| test.c:87:10:87:11 | v2 | semmle.label | v2 | -| test.c:88:12:88:13 | v2 | semmle.label | v2 | -| test.c:89:11:89:12 | v2 | semmle.label | v2 | -| test.c:90:13:90:14 | v2 | semmle.label | v2 | +| test.c:85:3:85:12 | v2 | semmle.label | v2 | +| test.c:86:3:86:13 | v2 | semmle.label | v2 | +| test.c:87:3:87:11 | v2 | semmle.label | v2 | +| test.c:88:3:88:13 | v2 | semmle.label | v2 | +| test.c:89:3:89:12 | v2 | semmle.label | v2 | +| test.c:90:3:90:14 | v2 | semmle.label | v2 | +| test.c:93:14:93:16 | & ... | semmle.label | & ... | | test.c:93:14:93:16 | & ... | semmle.label | & ... | | test.c:93:14:93:16 | & ... | semmle.label | & ... | -| test.c:94:11:94:12 | v3 | semmle.label | v3 | -| test.c:95:12:95:13 | v3 | semmle.label | v3 | -| test.c:96:10:96:11 | v3 | semmle.label | v3 | -| test.c:97:12:97:13 | v3 | semmle.label | v3 | -| test.c:98:11:98:12 | v3 | semmle.label | v3 | -| test.c:99:13:99:14 | v3 | semmle.label | v3 | +| test.c:94:3:94:12 | v3 | semmle.label | v3 | +| test.c:95:3:95:13 | v3 | semmle.label | v3 | +| test.c:96:3:96:11 | v3 | semmle.label | v3 | +| test.c:97:3:97:13 | v3 | semmle.label | v3 | +| test.c:98:3:98:12 | v3 | semmle.label | v3 | +| test.c:99:3:99:14 | v3 | semmle.label | v3 | | test.c:102:14:102:16 | & ... | semmle.label | & ... | | test.c:102:14:102:16 | & ... | semmle.label | & ... | -| test.c:103:11:103:12 | v4 | semmle.label | v4 | -| test.c:104:12:104:13 | v4 | semmle.label | v4 | -| test.c:105:10:105:11 | v4 | semmle.label | v4 | -| test.c:106:12:106:13 | v4 | semmle.label | v4 | -| test.c:107:11:107:12 | v4 | semmle.label | v4 | -| test.c:108:13:108:14 | v4 | semmle.label | v4 | +| test.c:102:14:102:16 | & ... | semmle.label | & ... | +| test.c:103:3:103:12 | v4 | semmle.label | v4 | +| test.c:104:3:104:13 | v4 | semmle.label | v4 | +| test.c:105:3:105:11 | v4 | semmle.label | v4 | +| test.c:106:3:106:13 | v4 | semmle.label | v4 | +| test.c:107:3:107:12 | v4 | semmle.label | v4 | +| test.c:108:3:108:14 | v4 | semmle.label | v4 | +| test.c:111:14:111:16 | & ... | semmle.label | & ... | | test.c:111:14:111:16 | & ... | semmle.label | & ... | | test.c:111:14:111:16 | & ... | semmle.label | & ... | -| test.c:112:11:112:12 | v5 | semmle.label | v5 | -| test.c:113:12:113:13 | v5 | semmle.label | v5 | -| test.c:114:10:114:11 | v5 | semmle.label | v5 | -| test.c:115:12:115:13 | v5 | semmle.label | v5 | -| test.c:116:11:116:12 | v5 | semmle.label | v5 | -| test.c:117:13:117:14 | v5 | semmle.label | v5 | +| test.c:112:3:112:12 | v5 | semmle.label | v5 | +| test.c:113:3:113:13 | v5 | semmle.label | v5 | +| test.c:114:3:114:11 | v5 | semmle.label | v5 | +| test.c:115:3:115:13 | v5 | semmle.label | v5 | +| test.c:116:3:116:12 | v5 | semmle.label | v5 | +| test.c:117:3:117:14 | v5 | semmle.label | v5 | +| test.c:120:14:120:16 | & ... | semmle.label | & ... | | test.c:120:14:120:16 | & ... | semmle.label | & ... | | test.c:120:14:120:16 | & ... | semmle.label | & ... | -| test.c:121:11:121:12 | v6 | semmle.label | v6 | -| test.c:122:12:122:13 | v6 | semmle.label | v6 | -| test.c:123:10:123:11 | v6 | semmle.label | v6 | -| test.c:124:12:124:13 | v6 | semmle.label | v6 | -| test.c:125:11:125:12 | v6 | semmle.label | v6 | -| test.c:126:13:126:14 | v6 | semmle.label | v6 | +| test.c:121:3:121:12 | v6 | semmle.label | v6 | +| test.c:122:3:122:13 | v6 | semmle.label | v6 | +| test.c:123:3:123:11 | v6 | semmle.label | v6 | +| test.c:124:3:124:13 | v6 | semmle.label | v6 | +| test.c:125:3:125:12 | v6 | semmle.label | v6 | +| test.c:126:3:126:14 | v6 | semmle.label | v6 | | test.c:129:22:129:22 | v | semmle.label | v | -| test.c:130:17:130:17 | v | semmle.label | v | -| test.c:135:21:135:23 | & ... | semmle.label | & ... | -| test.c:135:21:135:23 | & ... | semmle.label | & ... | -| test.c:138:21:138:23 | & ... | semmle.label | & ... | -| test.c:138:21:138:23 | & ... | semmle.label | & ... | -| test.c:158:13:158:20 | & ... | semmle.label | & ... | -| test.c:161:13:161:20 | & ... | semmle.label | & ... | -| test.c:162:16:162:18 | & ... | semmle.label | & ... | -| test.c:166:24:166:29 | call to malloc | semmle.label | call to malloc | -| test.c:166:24:166:29 | call to malloc | semmle.label | call to malloc | -| test.c:167:13:167:15 | & ... | semmle.label | & ... | -| test.c:168:16:168:17 | s1 | semmle.label | s1 | +| test.c:130:10:130:17 | v | semmle.label | v | +| test.c:135:13:135:23 | & ... | semmle.label | & ... | +| test.c:135:13:135:23 | & ... | semmle.label | & ... | +| test.c:138:13:138:23 | & ... | semmle.label | & ... | +| test.c:138:13:138:23 | & ... | semmle.label | & ... | +| test.c:158:3:158:20 | & ... | semmle.label | & ... | +| test.c:161:3:161:20 | & ... | semmle.label | & ... | +| test.c:162:3:162:18 | & ... | semmle.label | & ... | +| test.c:166:15:166:33 | call to malloc | semmle.label | call to malloc | +| test.c:166:15:166:33 | call to malloc | semmle.label | call to malloc | +| test.c:166:15:166:33 | call to malloc | semmle.label | call to malloc | +| test.c:167:3:167:15 | & ... | semmle.label | & ... | +| test.c:168:3:168:17 | s1 | semmle.label | s1 | | test.c:169:13:169:14 | s1 | semmle.label | s1 | | test.c:169:13:169:14 | s1 | semmle.label | s1 | -| test.c:172:11:172:12 | s2 | semmle.label | s2 | -| test.c:173:13:173:14 | s2 | semmle.label | s2 | +| test.c:172:3:172:12 | s2 | semmle.label | s2 | +| test.c:173:3:173:14 | s2 | semmle.label | s2 | | test.c:174:13:174:14 | s2 | semmle.label | s2 | | test.c:174:13:174:14 | s2 | semmle.label | s2 | -| test.c:177:11:177:12 | s3 | semmle.label | s3 | -| test.c:178:13:178:14 | s3 | semmle.label | s3 | +| test.c:177:3:177:12 | s3 | semmle.label | s3 | +| test.c:178:3:178:14 | s3 | semmle.label | s3 | | test.c:179:13:179:14 | s3 | semmle.label | s3 | | test.c:179:13:179:14 | s3 | semmle.label | s3 | | test.c:183:14:183:26 | call to aligned_alloc | semmle.label | call to aligned_alloc | -| test.c:184:11:184:12 | v1 | semmle.label | v1 | -| test.c:185:10:185:11 | v1 | semmle.label | v1 | -| test.c:186:13:186:14 | v1 | semmle.label | v1 | +| test.c:183:14:183:26 | call to aligned_alloc | semmle.label | call to aligned_alloc | +| test.c:184:3:184:12 | v1 | semmle.label | v1 | +| test.c:185:3:185:11 | v1 | semmle.label | v1 | +| test.c:186:3:186:14 | v1 | semmle.label | v1 | | test.c:187:13:187:14 | v1 | semmle.label | v1 | | test.c:189:14:189:26 | call to aligned_alloc | semmle.label | call to aligned_alloc | +| test.c:189:14:189:26 | call to aligned_alloc | semmle.label | call to aligned_alloc | | test.c:190:13:190:14 | v2 | semmle.label | v2 | -| test.c:214:11:214:12 | p2 | semmle.label | p2 | -| test.c:215:12:215:13 | p2 | semmle.label | p2 | -| test.c:216:10:216:11 | p2 | semmle.label | p2 | -| test.c:217:11:217:12 | p2 | semmle.label | p2 | -| test.c:218:12:218:13 | p2 | semmle.label | p2 | -| test.c:219:13:219:14 | p2 | semmle.label | p2 | +| test.c:214:3:214:12 | p2 | semmle.label | p2 | +| test.c:215:3:215:13 | p2 | semmle.label | p2 | +| test.c:216:3:216:11 | p2 | semmle.label | p2 | +| test.c:217:3:217:12 | p2 | semmle.label | p2 | +| test.c:218:3:218:13 | p2 | semmle.label | p2 | +| test.c:219:3:219:14 | p2 | semmle.label | p2 | +| test.c:222:3:222:9 | ... = ... | semmle.label | ... = ... | | test.c:222:8:222:9 | p2 | semmle.label | p2 | | test.c:222:8:222:9 | p2 | semmle.label | p2 | -| test.c:223:11:223:12 | v1 | semmle.label | v1 | -| test.c:224:12:224:13 | v1 | semmle.label | v1 | -| test.c:225:10:225:11 | v1 | semmle.label | v1 | -| test.c:226:12:226:13 | v1 | semmle.label | v1 | -| test.c:227:11:227:12 | v1 | semmle.label | v1 | -| test.c:228:13:228:14 | v1 | semmle.label | v1 | +| test.c:223:3:223:12 | v1 | semmle.label | v1 | +| test.c:224:3:224:13 | v1 | semmle.label | v1 | +| test.c:225:3:225:11 | v1 | semmle.label | v1 | +| test.c:226:3:226:13 | v1 | semmle.label | v1 | +| test.c:227:3:227:12 | v1 | semmle.label | v1 | +| test.c:228:3:228:14 | v1 | semmle.label | v1 | +| test.c:238:13:238:14 | & ... | semmle.label | & ... | | test.c:238:13:238:14 | & ... | semmle.label | & ... | | test.c:240:16:240:19 | & ... | semmle.label | & ... | -| test.c:241:15:241:18 | & ... | semmle.label | & ... | +| test.c:240:16:240:19 | & ... | semmle.label | & ... | | test.c:241:15:241:18 | & ... | semmle.label | & ... | | test.c:244:12:244:13 | ip | semmle.label | ip | | test.c:246:9:246:12 | & ... | semmle.label | & ... | | test.c:247:9:247:12 | & ... | semmle.label | & ... | | test.c:252:16:252:18 | & ... | semmle.label | & ... | -| test.c:254:11:254:13 | ps1 | semmle.label | ps1 | -| test.c:255:11:255:13 | & ... | semmle.label | & ... | -| test.c:256:10:256:12 | ps1 | semmle.label | ps1 | -| test.c:257:10:257:12 | & ... | semmle.label | & ... | +| test.c:252:16:252:18 | & ... | semmle.label | & ... | +| test.c:254:3:254:13 | ps1 | semmle.label | ps1 | +| test.c:255:3:255:13 | & ... | semmle.label | & ... | +| test.c:256:3:256:12 | ps1 | semmle.label | ps1 | +| test.c:257:3:257:12 | & ... | semmle.label | & ... | subpaths #select -| test.c:8:3:8:14 | (short *)... | test.c:8:12:8:14 | & ... | test.c:8:12:8:14 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type short with 2-byte alignment. | test.c:8:12:8:14 | & ... | address-of expression | -| test.c:9:3:9:12 | (int *)... | test.c:9:10:9:12 | & ... | test.c:9:10:9:12 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:9:10:9:12 | & ... | address-of expression | -| test.c:10:3:10:13 | (long *)... | test.c:10:11:10:13 | & ... | test.c:10:11:10:13 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:10:11:10:13 | & ... | address-of expression | -| test.c:11:3:11:14 | (float *)... | test.c:11:12:11:14 | & ... | test.c:11:12:11:14 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:11:12:11:14 | & ... | address-of expression | -| test.c:12:3:12:15 | (double *)... | test.c:12:13:12:15 | & ... | test.c:12:13:12:15 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:12:13:12:15 | & ... | address-of expression | -| test.c:17:3:17:12 | (int *)... | test.c:17:10:17:12 | & ... | test.c:17:10:17:12 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:17:10:17:12 | & ... | address-of expression | -| test.c:18:3:18:13 | (long *)... | test.c:18:11:18:13 | & ... | test.c:18:11:18:13 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:18:11:18:13 | & ... | address-of expression | -| test.c:19:3:19:14 | (float *)... | test.c:19:12:19:14 | & ... | test.c:19:12:19:14 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:19:12:19:14 | & ... | address-of expression | -| test.c:20:3:20:15 | (double *)... | test.c:20:13:20:15 | & ... | test.c:20:13:20:15 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:20:13:20:15 | & ... | address-of expression | -| test.c:27:3:27:13 | (long *)... | test.c:27:11:27:13 | & ... | test.c:27:11:27:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:27:11:27:13 | & ... | address-of expression | -| test.c:28:3:28:15 | (double *)... | test.c:28:13:28:15 | & ... | test.c:28:13:28:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:28:13:28:15 | & ... | address-of expression | -| test.c:35:3:35:13 | (long *)... | test.c:35:11:35:13 | & ... | test.c:35:11:35:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:35:11:35:13 | & ... | address-of expression | -| test.c:36:3:36:15 | (double *)... | test.c:36:13:36:15 | & ... | test.c:36:13:36:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:36:13:36:15 | & ... | address-of expression | -| test.c:61:3:61:13 | (long *)... | test.c:61:11:61:13 | & ... | test.c:61:11:61:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:61:11:61:13 | & ... | address-of expression | -| test.c:62:3:62:15 | (double *)... | test.c:62:13:62:15 | & ... | test.c:62:13:62:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:62:13:62:15 | & ... | address-of expression | -| test.c:77:3:77:13 | (short *)... | test.c:75:14:75:16 | & ... | test.c:77:12:77:13 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type short with 2-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | -| test.c:78:3:78:11 | (int *)... | test.c:75:14:75:16 | & ... | test.c:78:10:78:11 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | -| test.c:79:3:79:13 | (float *)... | test.c:75:14:75:16 | & ... | test.c:79:12:79:13 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | -| test.c:80:3:80:12 | (long *)... | test.c:75:14:75:16 | & ... | test.c:80:11:80:12 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | -| test.c:81:3:81:14 | (double *)... | test.c:75:14:75:16 | & ... | test.c:81:13:81:14 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | -| test.c:87:3:87:11 | (int *)... | test.c:84:14:84:16 | & ... | test.c:87:10:87:11 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | -| test.c:88:3:88:13 | (float *)... | test.c:84:14:84:16 | & ... | test.c:88:12:88:13 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | -| test.c:89:3:89:12 | (long *)... | test.c:84:14:84:16 | & ... | test.c:89:11:89:12 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | -| test.c:90:3:90:14 | (double *)... | test.c:84:14:84:16 | & ... | test.c:90:13:90:14 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | -| test.c:98:3:98:12 | (long *)... | test.c:93:14:93:16 | & ... | test.c:98:11:98:12 | v3 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:93:14:93:16 | & ... | address-of expression | -| test.c:99:3:99:14 | (double *)... | test.c:93:14:93:16 | & ... | test.c:99:13:99:14 | v3 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:93:14:93:16 | & ... | address-of expression | -| test.c:107:3:107:12 | (long *)... | test.c:102:14:102:16 | & ... | test.c:107:11:107:12 | v4 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:102:14:102:16 | & ... | address-of expression | -| test.c:108:3:108:14 | (double *)... | test.c:102:14:102:16 | & ... | test.c:108:13:108:14 | v4 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:102:14:102:16 | & ... | address-of expression | -| test.c:130:10:130:17 | (int *)... | test.c:135:21:135:23 | & ... | test.c:130:17:130:17 | v | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:135:21:135:23 | & ... | address-of expression | -| test.c:130:10:130:17 | (int *)... | test.c:174:13:174:14 | s2 | test.c:130:17:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:174:13:174:14 | s2 | pointer base type short | -| test.c:130:10:130:17 | (int *)... | test.c:179:13:179:14 | s3 | test.c:130:17:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:179:13:179:14 | s3 | pointer base type short | -| test.c:130:10:130:17 | (int *)... | test.c:189:14:189:26 | call to aligned_alloc | test.c:130:17:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:189:14:189:26 | call to aligned_alloc | call to aligned_alloc | -| test.c:158:3:158:20 | (size_t *)... | test.c:158:13:158:20 | & ... | test.c:158:13:158:20 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:158:13:158:20 | & ... | address-of expression | -| test.c:162:3:162:18 | (S3 *)... | test.c:162:16:162:18 | & ... | test.c:162:16:162:18 | & ... | Cast from pointer with 8-byte alignment (defined by $@) to pointer with base type S3 with 64-byte alignment. | test.c:162:16:162:18 | & ... | address-of expression | -| test.c:168:3:168:17 | (S3 *)... | test.c:166:24:166:29 | call to malloc | test.c:168:16:168:17 | s1 | Cast from pointer with 16-byte alignment (defined by $@) to pointer with base type S3 with 64-byte alignment. | test.c:166:24:166:29 | call to malloc | call to malloc | -| test.c:173:3:173:14 | (size_t *)... | test.c:173:13:173:14 | s2 | test.c:173:13:173:14 | s2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:173:13:173:14 | s2 | pointer base type short | -| test.c:178:3:178:14 | (size_t *)... | test.c:178:13:178:14 | s3 | test.c:178:13:178:14 | s3 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:178:13:178:14 | s3 | pointer base type short | -| test.c:186:3:186:14 | (size_t *)... | test.c:183:14:183:26 | call to aligned_alloc | test.c:186:13:186:14 | v1 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:183:14:183:26 | call to aligned_alloc | call to aligned_alloc | -| test.c:216:3:216:11 | (int *)... | test.c:216:10:216:11 | p2 | test.c:216:10:216:11 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:216:10:216:11 | p2 | pointer base type short | -| test.c:217:3:217:12 | (long *)... | test.c:217:11:217:12 | p2 | test.c:217:11:217:12 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:217:11:217:12 | p2 | pointer base type short | -| test.c:218:3:218:13 | (float *)... | test.c:218:12:218:13 | p2 | test.c:218:12:218:13 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:218:12:218:13 | p2 | pointer base type short | -| test.c:219:3:219:14 | (double *)... | test.c:219:13:219:14 | p2 | test.c:219:13:219:14 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:219:13:219:14 | p2 | pointer base type short | -| test.c:225:3:225:11 | (int *)... | test.c:222:8:222:9 | p2 | test.c:225:10:225:11 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | -| test.c:226:3:226:13 | (float *)... | test.c:222:8:222:9 | p2 | test.c:226:12:226:13 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | -| test.c:227:3:227:12 | (long *)... | test.c:222:8:222:9 | p2 | test.c:227:11:227:12 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | -| test.c:228:3:228:14 | (double *)... | test.c:222:8:222:9 | p2 | test.c:228:13:228:14 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | -| test.c:256:3:256:12 | (int *)... | test.c:252:16:252:18 | & ... | test.c:256:10:256:12 | ps1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:252:16:252:18 | & ... | address-of expression | -| test.c:257:3:257:12 | (int *)... | test.c:257:10:257:12 | & ... | test.c:257:10:257:12 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:257:10:257:12 | & ... | address-of expression | +| test.c:8:3:8:14 | (short *)... | test.c:8:3:8:14 | & ... | test.c:8:3:8:14 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type short with 2-byte alignment. | test.c:8:12:8:14 | & ... | address-of expression | +| test.c:9:3:9:12 | (int *)... | test.c:9:3:9:12 | & ... | test.c:9:3:9:12 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:9:10:9:12 | & ... | address-of expression | +| test.c:10:3:10:13 | (long *)... | test.c:10:3:10:13 | & ... | test.c:10:3:10:13 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:10:11:10:13 | & ... | address-of expression | +| test.c:11:3:11:14 | (float *)... | test.c:11:3:11:14 | & ... | test.c:11:3:11:14 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:11:12:11:14 | & ... | address-of expression | +| test.c:12:3:12:15 | (double *)... | test.c:12:3:12:15 | & ... | test.c:12:3:12:15 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:12:13:12:15 | & ... | address-of expression | +| test.c:17:3:17:12 | (int *)... | test.c:17:3:17:12 | & ... | test.c:17:3:17:12 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:17:10:17:12 | & ... | address-of expression | +| test.c:18:3:18:13 | (long *)... | test.c:18:3:18:13 | & ... | test.c:18:3:18:13 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:18:11:18:13 | & ... | address-of expression | +| test.c:19:3:19:14 | (float *)... | test.c:19:3:19:14 | & ... | test.c:19:3:19:14 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:19:12:19:14 | & ... | address-of expression | +| test.c:20:3:20:15 | (double *)... | test.c:20:3:20:15 | & ... | test.c:20:3:20:15 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:20:13:20:15 | & ... | address-of expression | +| test.c:27:3:27:13 | (long *)... | test.c:27:3:27:13 | & ... | test.c:27:3:27:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:27:11:27:13 | & ... | address-of expression | +| test.c:28:3:28:15 | (double *)... | test.c:28:3:28:15 | & ... | test.c:28:3:28:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:28:13:28:15 | & ... | address-of expression | +| test.c:35:3:35:13 | (long *)... | test.c:35:3:35:13 | & ... | test.c:35:3:35:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:35:11:35:13 | & ... | address-of expression | +| test.c:36:3:36:15 | (double *)... | test.c:36:3:36:15 | & ... | test.c:36:3:36:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:36:13:36:15 | & ... | address-of expression | +| test.c:61:3:61:13 | (long *)... | test.c:61:3:61:13 | & ... | test.c:61:3:61:13 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:61:11:61:13 | & ... | address-of expression | +| test.c:62:3:62:15 | (double *)... | test.c:62:3:62:15 | & ... | test.c:62:3:62:15 | & ... | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:62:13:62:15 | & ... | address-of expression | +| test.c:77:3:77:13 | (short *)... | test.c:75:14:75:16 | & ... | test.c:77:3:77:13 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type short with 2-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | +| test.c:78:3:78:11 | (int *)... | test.c:75:14:75:16 | & ... | test.c:78:3:78:11 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | +| test.c:79:3:79:13 | (float *)... | test.c:75:14:75:16 | & ... | test.c:79:3:79:13 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | +| test.c:80:3:80:12 | (long *)... | test.c:75:14:75:16 | & ... | test.c:80:3:80:12 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | +| test.c:81:3:81:14 | (double *)... | test.c:75:14:75:16 | & ... | test.c:81:3:81:14 | v1 | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:75:14:75:16 | & ... | address-of expression | +| test.c:87:3:87:11 | (int *)... | test.c:84:14:84:16 | & ... | test.c:87:3:87:11 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | +| test.c:88:3:88:13 | (float *)... | test.c:84:14:84:16 | & ... | test.c:88:3:88:13 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | +| test.c:89:3:89:12 | (long *)... | test.c:84:14:84:16 | & ... | test.c:89:3:89:12 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | +| test.c:90:3:90:14 | (double *)... | test.c:84:14:84:16 | & ... | test.c:90:3:90:14 | v2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:84:14:84:16 | & ... | address-of expression | +| test.c:98:3:98:12 | (long *)... | test.c:93:14:93:16 | & ... | test.c:98:3:98:12 | v3 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:93:14:93:16 | & ... | address-of expression | +| test.c:99:3:99:14 | (double *)... | test.c:93:14:93:16 | & ... | test.c:99:3:99:14 | v3 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:93:14:93:16 | & ... | address-of expression | +| test.c:107:3:107:12 | (long *)... | test.c:102:14:102:16 | & ... | test.c:107:3:107:12 | v4 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:102:14:102:16 | & ... | address-of expression | +| test.c:108:3:108:14 | (double *)... | test.c:102:14:102:16 | & ... | test.c:108:3:108:14 | v4 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:102:14:102:16 | & ... | address-of expression | +| test.c:130:10:130:17 | (int *)... | test.c:135:13:135:23 | & ... | test.c:130:10:130:17 | v | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:135:21:135:23 | & ... | address-of expression | +| test.c:130:10:130:17 | (int *)... | test.c:174:13:174:14 | s2 | test.c:130:10:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:174:13:174:14 | s2 | pointer base type short | +| test.c:130:10:130:17 | (int *)... | test.c:179:13:179:14 | s3 | test.c:130:10:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:179:13:179:14 | s3 | pointer base type short | +| test.c:130:10:130:17 | (int *)... | test.c:189:14:189:26 | call to aligned_alloc | test.c:130:10:130:17 | v | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:189:14:189:26 | call to aligned_alloc | call to aligned_alloc | +| test.c:158:3:158:20 | (size_t *)... | test.c:158:3:158:20 | & ... | test.c:158:3:158:20 | & ... | Cast from pointer with 1-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:158:13:158:20 | & ... | address-of expression | +| test.c:162:3:162:18 | (S3 *)... | test.c:162:3:162:18 | & ... | test.c:162:3:162:18 | & ... | Cast from pointer with 8-byte alignment (defined by $@) to pointer with base type S3 with 64-byte alignment. | test.c:162:16:162:18 | & ... | address-of expression | +| test.c:168:3:168:17 | (S3 *)... | test.c:166:15:166:33 | call to malloc | test.c:168:3:168:17 | s1 | Cast from pointer with 16-byte alignment (defined by $@) to pointer with base type S3 with 64-byte alignment. | test.c:166:24:166:29 | call to malloc | call to malloc | +| test.c:173:3:173:14 | (size_t *)... | test.c:173:3:173:14 | s2 | test.c:173:3:173:14 | s2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:173:13:173:14 | s2 | pointer base type short | +| test.c:178:3:178:14 | (size_t *)... | test.c:178:3:178:14 | s3 | test.c:178:3:178:14 | s3 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:178:13:178:14 | s3 | pointer base type short | +| test.c:186:3:186:14 | (size_t *)... | test.c:183:14:183:26 | call to aligned_alloc | test.c:186:3:186:14 | v1 | Cast from pointer with 4-byte alignment (defined by $@) to pointer with base type unsigned long with 8-byte alignment. | test.c:183:14:183:26 | call to aligned_alloc | call to aligned_alloc | +| test.c:216:3:216:11 | (int *)... | test.c:216:3:216:11 | p2 | test.c:216:3:216:11 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:216:10:216:11 | p2 | pointer base type short | +| test.c:217:3:217:12 | (long *)... | test.c:217:3:217:12 | p2 | test.c:217:3:217:12 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:217:11:217:12 | p2 | pointer base type short | +| test.c:218:3:218:13 | (float *)... | test.c:218:3:218:13 | p2 | test.c:218:3:218:13 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:218:12:218:13 | p2 | pointer base type short | +| test.c:219:3:219:14 | (double *)... | test.c:219:3:219:14 | p2 | test.c:219:3:219:14 | p2 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:219:13:219:14 | p2 | pointer base type short | +| test.c:225:3:225:11 | (int *)... | test.c:222:8:222:9 | p2 | test.c:225:3:225:11 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | +| test.c:226:3:226:13 | (float *)... | test.c:222:8:222:9 | p2 | test.c:226:3:226:13 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type float with 4-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | +| test.c:227:3:227:12 | (long *)... | test.c:222:8:222:9 | p2 | test.c:227:3:227:12 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type long with 8-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | +| test.c:228:3:228:14 | (double *)... | test.c:222:8:222:9 | p2 | test.c:228:3:228:14 | v1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type double with 8-byte alignment. | test.c:222:8:222:9 | p2 | pointer base type short | +| test.c:256:3:256:12 | (int *)... | test.c:252:16:252:18 | & ... | test.c:256:3:256:12 | ps1 | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:252:16:252:18 | & ... | address-of expression | +| test.c:257:3:257:12 | (int *)... | test.c:257:3:257:12 | & ... | test.c:257:3:257:12 | & ... | Cast from pointer with 2-byte alignment (defined by $@) to pointer with base type int with 4-byte alignment. | test.c:257:10:257:12 | & ... | address-of expression | diff --git a/c/cert/test/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.expected b/c/cert/test/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.expected index 52cb85e5c4..20c108cfa0 100644 --- a/c/cert/test/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.expected +++ b/c/cert/test/rules/FIO40-C/ResetStringsOnFgetsOrFgetwsFailure.expected @@ -1,6 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ResetStringsOnFgetsOrFgetwsFailure.ql:48,11-19) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ResetStringsOnFgetsOrFgetwsFailure.ql:48,31-39) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ResetStringsOnFgetsOrFgetwsFailure.ql:49,13-21) | test.c:20:10:20:12 | buf | The buffer is not reset before being referenced following a failed $@. | test.c:15:7:15:11 | call to fgets | call to fgets | | test.c:57:10:57:12 | buf | The buffer is not reset before being referenced following a failed $@. | test.c:52:7:52:11 | call to fgets | call to fgets | | test.c:66:18:66:20 | buf | The buffer is not reset before being referenced following a failed $@. | test.c:61:7:61:11 | call to fgets | call to fgets | diff --git a/c/cert/test/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.expected b/c/cert/test/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.expected index a211aa4002..1b2923b780 100644 --- a/c/cert/test/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.expected +++ b/c/cert/test/rules/FIO45-C/ToctouRaceConditionsWhileAccessingFiles.expected @@ -1,3 +1,2 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ToctouRaceConditionsWhileAccessingFiles.ql:32,35-43) | test.c:4:13:4:17 | call to fopen | This call is trying to prevent an existing file from being overwritten by $@. An attacker might be able to exploit the race window between the two calls. | test.c:11:9:11:13 | call to fopen | another call | | test.c:88:13:88:17 | call to fopen | This call is trying to prevent an existing file from being overwritten by $@. An attacker might be able to exploit the race window between the two calls. | test.c:95:9:95:13 | call to fopen | another call | diff --git a/c/cert/test/rules/INT31-C/IntegerConversionCausesDataLoss.expected b/c/cert/test/rules/INT31-C/IntegerConversionCausesDataLoss.expected index ee18410a48..f7e4454342 100644 --- a/c/cert/test/rules/INT31-C/IntegerConversionCausesDataLoss.expected +++ b/c/cert/test/rules/INT31-C/IntegerConversionCausesDataLoss.expected @@ -2,6 +2,8 @@ | test.c:17:3:17:17 | (unsigned int)... | Conversion from signed int to unsigned int may cause data loss (casting from range -2147483648...2147483647 to range 0...4294967295). | | test.c:34:3:34:17 | (signed short)... | Conversion from signed int to signed short may cause data loss (casting from range -2147483648...2147483647 to range -32768...32767). | | test.c:51:3:51:19 | (unsigned short)... | Conversion from unsigned int to unsigned short may cause data loss (casting from range 0...4294967295 to range 0...65535). | +| test.c:74:14:74:15 | (unsigned int)... | Conversion from int to unsigned int may cause data loss (casting from range -1...-1 to range 0...4294967295). | +| test.c:77:14:77:23 | (time_t)... | Conversion from int to unsigned int may cause data loss (casting from range -1...-1 to range 0...4294967295). | | test.c:89:3:89:19 | (unsigned char)... | Conversion from signed int to unsigned char may cause data loss (casting from range 100000...100000 to range 0...255). | | test.c:92:3:92:19 | (unsigned char)... | Conversion from signed int to unsigned char may cause data loss (casting from range -129...-129 to range 0...255). | | test.c:93:3:93:19 | (unsigned char)... | Conversion from signed int to unsigned char may cause data loss (casting from range 256...256 to range 0...255). | diff --git a/c/cert/test/rules/INT31-C/test.c b/c/cert/test/rules/INT31-C/test.c index 08b09cf6b8..5988e5cc43 100644 --- a/c/cert/test/rules/INT31-C/test.c +++ b/c/cert/test/rules/INT31-C/test.c @@ -71,10 +71,10 @@ time_t time(time_t *seconds); void test_time_t_check_against_zero(time_t x) { time_t now = time(0); - if (now != -1) { // NON_COMPLIANT[FALSE_NEGATIVE] - there is no conversion - // here in our model + if (now != -1) { // NON_COMPLIANT } - if (now != (time_t)-1) { // COMPLIANT + + if (now != (time_t)-1) { // COMPLIANT[FALSE_POSITIVE] } } diff --git a/c/cert/test/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.expected b/c/cert/test/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.expected index 7ebeb7a8c1..70d60c528a 100644 --- a/c/cert/test/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.expected +++ b/c/cert/test/rules/MSC33-C/DoNotPassInvalidDataToTheAsctimeFunction.expected @@ -1,5 +1 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotPassInvalidDataToTheAsctimeFunction.ql:38,38-46) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotPassInvalidDataToTheAsctimeFunction.ql:39,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotPassInvalidDataToTheAsctimeFunction.ql:46,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotPassInvalidDataToTheAsctimeFunction.ql:49,27-35) | test.c:6:24:6:30 | time_tm | The function `asctime` and `asctime_r` should be discouraged. Unsanitized input can overflow the output buffer. | diff --git a/c/common/src/codingstandards/c/initialization/GlobalInitializationAnalysis.qll b/c/common/src/codingstandards/c/initialization/GlobalInitializationAnalysis.qll index 2906883ae9..cf32f9bdc6 100644 --- a/c/common/src/codingstandards/c/initialization/GlobalInitializationAnalysis.qll +++ b/c/common/src/codingstandards/c/initialization/GlobalInitializationAnalysis.qll @@ -1,6 +1,6 @@ import cpp import codingstandards.c.Objects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type signature module GlobalInitializationAnalysisConfigSig { diff --git a/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected b/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected index 75866b8503..f9fe72c2a4 100644 --- a/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected +++ b/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected @@ -4,19 +4,27 @@ problems | test.c:13:10:13:11 | p4 | test.c:5:14:5:15 | l2 | test.c:13:10:13:11 | p4 | Subtraction between left operand pointing to array $@ and other operand pointing to array $@. | test.c:3:7:3:8 | l2 | l2 | test.c:2:7:2:8 | l1 | l1 | | test.c:13:15:13:16 | l1 | test.c:13:15:13:16 | l1 | test.c:13:15:13:16 | l1 | Subtraction between right operand pointing to array $@ and other operand pointing to array $@. | test.c:2:7:2:8 | l1 | l1 | test.c:3:7:3:8 | l2 | l2 | edges -| test.c:4:14:4:15 | l1 | test.c:4:14:4:18 | access to array | provenance | Config | -| test.c:4:14:4:18 | access to array | test.c:10:10:10:11 | p1 | provenance | | -| test.c:4:14:4:18 | access to array | test.c:12:10:12:11 | p1 | provenance | | -| test.c:5:14:5:15 | l2 | test.c:5:14:5:19 | access to array | provenance | Config | -| test.c:5:14:5:19 | access to array | test.c:11:10:11:11 | p2 | provenance | | -| test.c:5:14:5:19 | access to array | test.c:12:15:12:16 | p2 | provenance | | -| test.c:5:14:5:19 | access to array | test.c:13:10:13:11 | p4 | provenance | | -| test.c:5:14:5:19 | access to array | test.c:14:10:14:11 | p4 | provenance | | +| test.c:4:13:4:18 | & ... | test.c:4:13:4:18 | & ... | provenance | | +| test.c:4:13:4:18 | & ... | test.c:10:10:10:11 | p1 | provenance | | +| test.c:4:13:4:18 | & ... | test.c:12:10:12:11 | p1 | provenance | | +| test.c:4:14:4:15 | l1 | test.c:4:13:4:18 | & ... | provenance | Config | +| test.c:5:13:5:19 | & ... | test.c:5:13:5:19 | & ... | provenance | | +| test.c:5:13:5:19 | & ... | test.c:6:13:6:14 | p2 | provenance | | +| test.c:5:13:5:19 | & ... | test.c:11:10:11:11 | p2 | provenance | | +| test.c:5:13:5:19 | & ... | test.c:12:15:12:16 | p2 | provenance | | +| test.c:5:14:5:15 | l2 | test.c:5:13:5:19 | & ... | provenance | Config | +| test.c:6:13:6:14 | p2 | test.c:7:13:7:14 | p3 | provenance | | +| test.c:7:13:7:14 | p3 | test.c:13:10:13:11 | p4 | provenance | | +| test.c:7:13:7:14 | p3 | test.c:14:10:14:11 | p4 | provenance | | nodes +| test.c:4:13:4:18 | & ... | semmle.label | & ... | +| test.c:4:13:4:18 | & ... | semmle.label | & ... | | test.c:4:14:4:15 | l1 | semmle.label | l1 | -| test.c:4:14:4:18 | access to array | semmle.label | access to array | +| test.c:5:13:5:19 | & ... | semmle.label | & ... | +| test.c:5:13:5:19 | & ... | semmle.label | & ... | | test.c:5:14:5:15 | l2 | semmle.label | l2 | -| test.c:5:14:5:19 | access to array | semmle.label | access to array | +| test.c:6:13:6:14 | p2 | semmle.label | p2 | +| test.c:7:13:7:14 | p3 | semmle.label | p3 | | test.c:10:10:10:11 | p1 | semmle.label | p1 | | test.c:10:15:10:16 | l1 | semmle.label | l1 | | test.c:11:10:11:11 | p2 | semmle.label | p2 | diff --git a/c/misra/src/rules/DIR-5-3/BannedDynamicThreadCreation.ql b/c/misra/src/rules/DIR-5-3/BannedDynamicThreadCreation.ql index 4bb526306b..cb12a8156b 100644 --- a/c/misra/src/rules/DIR-5-3/BannedDynamicThreadCreation.ql +++ b/c/misra/src/rules/DIR-5-3/BannedDynamicThreadCreation.ql @@ -18,7 +18,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from CThreadCreateCall tc, Function enclosingFunction where diff --git a/c/misra/src/rules/DIR-5-3/ThreadCreatedByThread.ql b/c/misra/src/rules/DIR-5-3/ThreadCreatedByThread.ql index 207e763fa7..11f76de7ae 100644 --- a/c/misra/src/rules/DIR-5-3/ThreadCreatedByThread.ql +++ b/c/misra/src/rules/DIR-5-3/ThreadCreatedByThread.ql @@ -17,7 +17,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew class CThreadRoot extends Function { CThreadCreateCall threadCreate; diff --git a/c/misra/src/rules/RULE-18-6/ThreadLocalObjectAddressCopiedToGlobalObject.ql b/c/misra/src/rules/RULE-18-6/ThreadLocalObjectAddressCopiedToGlobalObject.ql index 6a520447d1..a8fea9558e 100644 --- a/c/misra/src/rules/RULE-18-6/ThreadLocalObjectAddressCopiedToGlobalObject.ql +++ b/c/misra/src/rules/RULE-18-6/ThreadLocalObjectAddressCopiedToGlobalObject.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.Objects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from AssignExpr assignment, Element threadLocal, ObjectIdentity static where diff --git a/c/misra/src/rules/RULE-22-12/NonstandardUseOfThreadingObject.ql b/c/misra/src/rules/RULE-22-12/NonstandardUseOfThreadingObject.ql index d92b4ccea6..15a437e7ed 100644 --- a/c/misra/src/rules/RULE-22-12/NonstandardUseOfThreadingObject.ql +++ b/c/misra/src/rules/RULE-22-12/NonstandardUseOfThreadingObject.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type predicate isThreadingObject(Type t) { t instanceof PossiblySpecified::Type } diff --git a/c/misra/src/rules/RULE-22-13/ThreadingObjectWithInvalidStorageDuration.ql b/c/misra/src/rules/RULE-22-13/ThreadingObjectWithInvalidStorageDuration.ql index 066cf3c295..18f3671202 100644 --- a/c/misra/src/rules/RULE-22-13/ThreadingObjectWithInvalidStorageDuration.ql +++ b/c/misra/src/rules/RULE-22-13/ThreadingObjectWithInvalidStorageDuration.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.Objects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type from ObjectIdentity obj, StorageDuration storageDuration, Type type diff --git a/c/misra/src/rules/RULE-22-14/MutexInitWithInvalidMutexType.ql b/c/misra/src/rules/RULE-22-14/MutexInitWithInvalidMutexType.ql index a122a0bec4..cda50fbf73 100644 --- a/c/misra/src/rules/RULE-22-14/MutexInitWithInvalidMutexType.ql +++ b/c/misra/src/rules/RULE-22-14/MutexInitWithInvalidMutexType.ql @@ -14,7 +14,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew predicate isBaseMutexType(EnumConstantAccess access) { access.getTarget().hasName(["mtx_plain", "mtx_timed"]) diff --git a/c/misra/src/rules/RULE-22-14/MutexInitializedInsideThread.ql b/c/misra/src/rules/RULE-22-14/MutexInitializedInsideThread.ql index 497fdaf14d..4b6afe9f5f 100644 --- a/c/misra/src/rules/RULE-22-14/MutexInitializedInsideThread.ql +++ b/c/misra/src/rules/RULE-22-14/MutexInitializedInsideThread.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from C11MutexSource mutexCreate, ThreadedFunction thread where diff --git a/c/misra/src/rules/RULE-22-14/MutexNotInitializedBeforeUse.ql b/c/misra/src/rules/RULE-22-14/MutexNotInitializedBeforeUse.ql index f78c25f981..7df3a2dc4d 100644 --- a/c/misra/src/rules/RULE-22-14/MutexNotInitializedBeforeUse.ql +++ b/c/misra/src/rules/RULE-22-14/MutexNotInitializedBeforeUse.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.Objects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type import codingstandards.c.initialization.GlobalInitializationAnalysis diff --git a/c/misra/src/rules/RULE-22-15/ThreadResourceDisposedBeforeThreadsJoined.ql b/c/misra/src/rules/RULE-22-15/ThreadResourceDisposedBeforeThreadsJoined.ql index ec4631ef1b..9f06f441d1 100644 --- a/c/misra/src/rules/RULE-22-15/ThreadResourceDisposedBeforeThreadsJoined.ql +++ b/c/misra/src/rules/RULE-22-15/ThreadResourceDisposedBeforeThreadsJoined.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.SubObjects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew newtype TThreadKind = TSpawned(C11ThreadCreateCall tcc) or diff --git a/c/misra/src/rules/RULE-22-17/InvalidOperationOnUnlockedMutex.ql b/c/misra/src/rules/RULE-22-17/InvalidOperationOnUnlockedMutex.ql index d85183a831..f2bb0a519c 100644 --- a/c/misra/src/rules/RULE-22-17/InvalidOperationOnUnlockedMutex.ql +++ b/c/misra/src/rules/RULE-22-17/InvalidOperationOnUnlockedMutex.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.SubObjects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.dominance.BehavioralSet /* A call to mtx_unlock() or cnd_wait() or cnd_timedwait(), which require a locked mutex */ diff --git a/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLocked.ql b/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLocked.ql index 17762b3eee..c1ace4489b 100644 --- a/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLocked.ql +++ b/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLocked.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.SubObjects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type from diff --git a/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLockedAudit.ql b/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLockedAudit.ql index 7e002585b6..1df7c03825 100644 --- a/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLockedAudit.ql +++ b/c/misra/src/rules/RULE-22-18/NonRecursiveMutexRecursivelyLockedAudit.ql @@ -18,7 +18,7 @@ import cpp import codeql.util.Boolean import codingstandards.c.misra import codingstandards.c.SubObjects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type predicate isTrackableMutex(CMutexFunctionCall lockCall, Boolean recursive) { diff --git a/c/misra/src/rules/RULE-22-19/ConditionVariableUsedWithMultipleMutexes.ql b/c/misra/src/rules/RULE-22-19/ConditionVariableUsedWithMultipleMutexes.ql index 0d5aa5399f..ce05c2dc74 100644 --- a/c/misra/src/rules/RULE-22-19/ConditionVariableUsedWithMultipleMutexes.ql +++ b/c/misra/src/rules/RULE-22-19/ConditionVariableUsedWithMultipleMutexes.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.SubObjects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew bindingset[cond, mutex] int countMutexesForConditionVariable(SubObject cond, SubObject mutex) { diff --git a/c/misra/src/rules/RULE-22-20/ThreadStorageNotInitializedBeforeUse.ql b/c/misra/src/rules/RULE-22-20/ThreadStorageNotInitializedBeforeUse.ql index 1edf4aa9c3..9a9d924247 100644 --- a/c/misra/src/rules/RULE-22-20/ThreadStorageNotInitializedBeforeUse.ql +++ b/c/misra/src/rules/RULE-22-20/ThreadStorageNotInitializedBeforeUse.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra import codingstandards.c.Objects -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.Type import codingstandards.c.initialization.GlobalInitializationAnalysis diff --git a/c/misra/src/rules/RULE-22-20/ThreadStoragePointerInitializedInsideThread.ql b/c/misra/src/rules/RULE-22-20/ThreadStoragePointerInitializedInsideThread.ql index 3c40ea7116..4b7c64d914 100644 --- a/c/misra/src/rules/RULE-22-20/ThreadStoragePointerInitializedInsideThread.ql +++ b/c/misra/src/rules/RULE-22-20/ThreadStoragePointerInitializedInsideThread.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.c.misra -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from TSSCreateFunctionCall tssCreate, ThreadedFunction thread where diff --git a/c/misra/src/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.ql b/c/misra/src/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.ql index 642813bbab..581439c629 100644 --- a/c/misra/src/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.ql +++ b/c/misra/src/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.c.misra import codingstandards.cpp.standardlibrary.FileAccess -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import semmle.code.cpp.valuenumbering.GlobalValueNumbering import semmle.code.cpp.controlflow.SubBasicBlocks diff --git a/c/misra/src/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.ql b/c/misra/src/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.ql index 2439d4ca47..2468caa61e 100644 --- a/c/misra/src/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.ql +++ b/c/misra/src/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.ql @@ -14,7 +14,7 @@ import cpp import codingstandards.c.misra import codingstandards.cpp.standardlibrary.FileAccess -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow module FileDFConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { diff --git a/c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected b/c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected index abd602e9c8..4028c67366 100644 --- a/c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected +++ b/c/misra/test/rules/RULE-2-4/UnusedTagDeclaration.expected @@ -3,5 +3,4 @@ | test.c:17:6:17:7 | E1 | struct E1 has an unused tag. | | test.c:31:10:31:11 | S7 | struct S7 has an unused tag. | | test.c:50:8:50:10 | S10 | struct S10 has an unused tag. | -| test.c:66:3:66:14 | S13 | struct S13 has an unused tag. | | test.c:79:8:79:10 | s14 | struct s14 has an unused tag. | diff --git a/c/misra/test/rules/RULE-2-4/test.c b/c/misra/test/rules/RULE-2-4/test.c index 64d05a1cc2..30cce2d224 100644 --- a/c/misra/test/rules/RULE-2-4/test.c +++ b/c/misra/test/rules/RULE-2-4/test.c @@ -63,9 +63,9 @@ struct S12 { // COMPLIANT }; void testMacroNameUsed() { - STRUCT_MACRO // COMPLIANT[FALSE_POSITIVE] - although the struct generated by - // the macro is never used in this expansion, it may be used in - // other expansions, so we don't want to report it as unused + STRUCT_MACRO // COMPLIANT - although the struct generated by the macro is + // never used in this expansion, it may be used in other + // expansions, so we don't want to report it as unused } void testMacroNameNotUsed() { diff --git a/c/misra/test/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.expected b/c/misra/test/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.expected index 0365f4980d..6111072ba8 100644 --- a/c/misra/test/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.expected +++ b/c/misra/test/rules/RULE-22-3/FileOpenForReadAndWriteOnDifferentStreams.expected @@ -1,4 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (FileOpenForReadAndWriteOnDifferentStreams.ql:39,9-17) | test.c:6:14:6:18 | call to fopen | The same file was already opened $@. Files should not be read and written at the same time using different streams. | test.c:5:14:5:18 | call to fopen | here | | test.c:17:14:17:18 | call to fopen | The same file was already opened $@. Files should not be read and written at the same time using different streams. | test.c:16:14:16:18 | call to fopen | here | | test.c:33:14:33:18 | call to fopen | The same file was already opened $@. Files should not be read and written at the same time using different streams. | test.c:32:14:32:18 | call to fopen | here | diff --git a/c/misra/test/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.expected b/c/misra/test/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.expected index dbf08e3d3d..0bfce133c5 100644 --- a/c/misra/test/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.expected +++ b/c/misra/test/rules/RULE-22-4/AttemptToWriteToAReadOnlyStream.expected @@ -1,8 +1,2 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:19,32-40) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:20,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:25,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:31,21-29) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:33,6-14) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (AttemptToWriteToAReadOnlyStream.ql:36,28-36) | test.c:10:3:10:9 | call to fprintf | Attempt to write to a $@ opened as read-only. | test.c:9:14:9:18 | call to fopen | stream | | test.c:15:3:15:9 | call to fprintf | Attempt to write to a $@ opened as read-only. | test.c:18:14:18:18 | call to fopen | stream | diff --git a/cpp/autosar/src/rules/A27-0-4/CStyleStringsUsed.ql b/cpp/autosar/src/rules/A27-0-4/CStyleStringsUsed.ql index b24a4a96cf..5ad2e9ee0a 100644 --- a/cpp/autosar/src/rules/A27-0-4/CStyleStringsUsed.ql +++ b/cpp/autosar/src/rules/A27-0-4/CStyleStringsUsed.ql @@ -14,7 +14,7 @@ import cpp import codingstandards.cpp.autosar -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow class InstanceOfCStyleString extends Expr { InstanceOfCStyleString() { diff --git a/cpp/autosar/src/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.ql b/cpp/autosar/src/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.ql index ac2375f6aa..eb818204ba 100644 --- a/cpp/autosar/src/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.ql +++ b/cpp/autosar/src/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.ql @@ -17,7 +17,7 @@ import cpp import codingstandards.cpp.autosar import codingstandards.cpp.Type -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import NonFinalClassToPointerArithmeticExprFlow::PathGraph class ArrayAccessOrPointerArith extends Expr { diff --git a/cpp/autosar/src/rules/A7-5-1/InvalidFunctionReturnType.ql b/cpp/autosar/src/rules/A7-5-1/InvalidFunctionReturnType.ql index c36bda6cdd..6b94c68cff 100644 --- a/cpp/autosar/src/rules/A7-5-1/InvalidFunctionReturnType.ql +++ b/cpp/autosar/src/rules/A7-5-1/InvalidFunctionReturnType.ql @@ -16,7 +16,7 @@ import cpp import codingstandards.cpp.autosar -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow from Parameter p, ReturnStmt ret where diff --git a/cpp/autosar/src/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql b/cpp/autosar/src/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql index 478f8dcdf0..458382c909 100644 --- a/cpp/autosar/src/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql +++ b/cpp/autosar/src/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.cpp.autosar import codingstandards.cpp.CommonTypes as CommonTypes -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow class AccessAwareMemberFunction extends MemberFunction { Class c; diff --git a/cpp/autosar/src/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql b/cpp/autosar/src/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql index 279ad08f3c..820efffaeb 100644 --- a/cpp/autosar/src/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql +++ b/cpp/autosar/src/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql @@ -14,7 +14,7 @@ import cpp import codingstandards.cpp.autosar -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow predicate pointeeIsModified(PointerDereferenceExpr e, Expr m) { exists(Assignment a | a.getLValue() = e and m = a) diff --git a/cpp/autosar/src/rules/M5-0-17/PointerSubtractionOnDifferentArrays.ql b/cpp/autosar/src/rules/M5-0-17/PointerSubtractionOnDifferentArrays.ql index d6d4f6130a..29feaa22d5 100644 --- a/cpp/autosar/src/rules/M5-0-17/PointerSubtractionOnDifferentArrays.ql +++ b/cpp/autosar/src/rules/M5-0-17/PointerSubtractionOnDifferentArrays.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.cpp.autosar -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import ArrayToPointerDiffOperandFlow::PathGraph module ArrayToPointerDiffOperandConfig implements DataFlow::ConfigSig { @@ -34,6 +34,8 @@ module ArrayToPointerDiffOperandConfig implements DataFlow::ConfigSig { // Add a flow step from the base to the array expression to track pointers to elements of the array. exists(ArrayExpr e | e.getArrayBase() = pred.asExpr() and e = succ.asExpr()) } + + predicate isBarrierIn(DataFlow::Node node) { isSource(node) } } module ArrayToPointerDiffOperandFlow = DataFlow::Global; diff --git a/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected b/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected index 14e68ab4a9..e757cdf984 100644 --- a/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected +++ b/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected @@ -1,4 +1,4 @@ | test.cpp:33:7:33:7 | call to operator A | User-defined conversion operators should not be used. | | test.cpp:35:24:35:24 | call to operator A * | User-defined conversion operators should not be used. | -| test.cpp:37:15:37:15 | call to operator A (*)[3] | User-defined conversion operators should not be used. | +| test.cpp:37:15:37:15 | call to operator B::array_A * | User-defined conversion operators should not be used. | | test.cpp:41:7:41:7 | call to operator A * | User-defined conversion operators should not be used. | diff --git a/cpp/autosar/test/rules/A27-0-4/CStyleStringsUsed.expected b/cpp/autosar/test/rules/A27-0-4/CStyleStringsUsed.expected index 555cb412b8..6184aad74e 100644 --- a/cpp/autosar/test/rules/A27-0-4/CStyleStringsUsed.expected +++ b/cpp/autosar/test/rules/A27-0-4/CStyleStringsUsed.expected @@ -1,6 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CStyleStringsUsed.ql:39,3-11) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CStyleStringsUsed.ql:39,23-31) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (CStyleStringsUsed.ql:39,47-55) | test.cpp:7:20:7:27 | CodeQL | Usage of C-style string in $@. | test.cpp:7:20:7:27 | CodeQL | expression | | test.cpp:7:20:7:27 | CodeQL | Usage of C-style string in $@. | test.cpp:16:16:16:17 | a1 | expression | | test.cpp:8:22:8:26 | call to c_str | Usage of C-style string in $@. | test.cpp:8:22:8:26 | call to c_str | expression | diff --git a/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected b/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected index e2b51e5fb9..fc29955b25 100644 --- a/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected +++ b/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected @@ -1,13 +1,11 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (PointerArithmeticUsedWithPointersToNonFinalClasses.ql:45,62-70) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (PointerArithmeticUsedWithPointersToNonFinalClasses.ql:46,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (PointerArithmeticUsedWithPointersToNonFinalClasses.ql:55,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (PointerArithmeticUsedWithPointersToNonFinalClasses.ql:61,3-11) edges | test.cpp:10:18:10:20 | foo | test.cpp:11:23:11:25 | foo | provenance | | | test.cpp:10:18:10:20 | foo | test.cpp:11:50:11:52 | foo | provenance | | | test.cpp:22:18:22:20 | foo | test.cpp:24:18:24:20 | foo | provenance | | +| test.cpp:35:11:35:17 | new | test.cpp:35:11:35:17 | new | provenance | | | test.cpp:35:11:35:17 | new | test.cpp:38:6:38:7 | l1 | provenance | | | test.cpp:35:11:35:17 | new | test.cpp:39:6:39:7 | l1 | provenance | | +| test.cpp:37:11:37:13 | & ... | test.cpp:37:11:37:13 | & ... | provenance | | | test.cpp:37:11:37:13 | & ... | test.cpp:40:6:40:7 | l3 | provenance | | | test.cpp:37:11:37:13 | & ... | test.cpp:41:6:41:7 | l3 | provenance | | | test.cpp:38:6:38:7 | l1 | test.cpp:10:18:10:20 | foo | provenance | | @@ -21,6 +19,8 @@ nodes | test.cpp:22:18:22:20 | foo | semmle.label | foo | | test.cpp:24:18:24:20 | foo | semmle.label | foo | | test.cpp:35:11:35:17 | new | semmle.label | new | +| test.cpp:35:11:35:17 | new | semmle.label | new | +| test.cpp:37:11:37:13 | & ... | semmle.label | & ... | | test.cpp:37:11:37:13 | & ... | semmle.label | & ... | | test.cpp:38:6:38:7 | l1 | semmle.label | l1 | | test.cpp:39:6:39:7 | l1 | semmle.label | l1 | diff --git a/cpp/autosar/test/rules/A7-5-1/InvalidFunctionReturnType.expected b/cpp/autosar/test/rules/A7-5-1/InvalidFunctionReturnType.expected index 3287ba88d1..b6d9490803 100644 --- a/cpp/autosar/test/rules/A7-5-1/InvalidFunctionReturnType.expected +++ b/cpp/autosar/test/rules/A7-5-1/InvalidFunctionReturnType.expected @@ -1,5 +1,2 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (InvalidFunctionReturnType.ql:27,3-11) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (InvalidFunctionReturnType.ql:27,23-31) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (InvalidFunctionReturnType.ql:27,51-59) | test.cpp:5:3:5:11 | return ... | Function test_refconst_return returns a reference or a pointer to $@ that is passed by reference to const. | test.cpp:4:44:4:44 | x | parameter | | test.cpp:8:3:8:14 | return ... | Function test_ptrconst_return returns a reference or a pointer to $@ that is passed by reference to const. | test.cpp:7:44:7:44 | x | parameter | diff --git a/cpp/autosar/test/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.expected b/cpp/autosar/test/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.expected index 70892c12c8..04c1f35a45 100644 --- a/cpp/autosar/test/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.expected +++ b/cpp/autosar/test/rules/A9-3-1/ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.expected @@ -1,6 +1,3 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql:73,3-11) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql:73,23-31) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (ReturnsNonConstRawPointersOrReferencesToPrivateOrProtectedData.ql:73,46-54) | test.cpp:20:8:20:12 | getB2 | Member function A::getB2 $@ a non-const raw pointer or reference to a private or protected $@. | test.cpp:20:25:20:25 | b | returns | test.cpp:54:7:54:7 | b | field | | test.cpp:22:8:22:12 | getB3 | Member function A::getB3 $@ a non-const raw pointer or reference to a private or protected $@. | test.cpp:22:25:22:26 | & ... | returns | test.cpp:54:7:54:7 | b | field | | test.cpp:24:8:24:13 | getB33 | Member function A::getB33 $@ a non-const raw pointer or reference to a private or protected $@. | test.cpp:26:12:26:13 | bb | returns | test.cpp:54:7:54:7 | b | field | diff --git a/cpp/autosar/test/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.expected b/cpp/autosar/test/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.expected index d0fe6416ca..9aec2314da 100644 --- a/cpp/autosar/test/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.expected +++ b/cpp/autosar/test/rules/M3-9-3/UnderlyingBitRepresentationsOfFloatingPointValuesUsed.expected @@ -1,5 +1,2 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql:27,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql:36,10-18) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (UnderlyingBitRepresentationsOfFloatingPointValuesUsed.ql:37,5-13) | test.cpp:5:3:5:20 | ... &= ... | Modification of bit-representation of float originated at $@ | test.cpp:4:24:4:60 | reinterpret_cast... | cast | | test.cpp:12:3:12:14 | ... &= ... | Modification of bit-representation of float originated at $@ | test.cpp:11:18:11:30 | (uint8_t *)... | cast | diff --git a/cpp/cert/src/rules/CON56-CPP/DoNotSpeculativelyLockALockedNonRecursiveMutex.ql b/cpp/cert/src/rules/CON56-CPP/DoNotSpeculativelyLockALockedNonRecursiveMutex.ql index 67edf2fc22..a462e60edb 100644 --- a/cpp/cert/src/rules/CON56-CPP/DoNotSpeculativelyLockALockedNonRecursiveMutex.ql +++ b/cpp/cert/src/rules/CON56-CPP/DoNotSpeculativelyLockALockedNonRecursiveMutex.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.cpp.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from LockProtectedControlFlowNode n where diff --git a/cpp/cert/src/rules/CON56-CPP/LockedALockedNonRecursiveMutexAudit.ql b/cpp/cert/src/rules/CON56-CPP/LockedALockedNonRecursiveMutexAudit.ql index 09ec2fa3d5..99ad966efa 100644 --- a/cpp/cert/src/rules/CON56-CPP/LockedALockedNonRecursiveMutexAudit.ql +++ b/cpp/cert/src/rules/CON56-CPP/LockedALockedNonRecursiveMutexAudit.ql @@ -19,7 +19,7 @@ import cpp import codingstandards.cpp.cert -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew from LockProtectedControlFlowNode n where diff --git a/cpp/cert/src/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.ql b/cpp/cert/src/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.ql index b4ac267225..2522f6c5e5 100644 --- a/cpp/cert/src/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.ql +++ b/cpp/cert/src/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.ql @@ -18,7 +18,7 @@ import cpp import codingstandards.cpp.cert -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import NonFinalClassToPointerArithmeticExprFlow::PathGraph class ArrayAccessOrPointerArith extends Expr { diff --git a/cpp/cert/src/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.ql b/cpp/cert/src/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.ql index 5322fbbde3..2c015aa680 100644 --- a/cpp/cert/src/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.ql +++ b/cpp/cert/src/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.ql @@ -20,7 +20,7 @@ import cpp import codingstandards.cpp.cert import codingstandards.cpp.standardlibrary.Random -import semmle.code.cpp.dataflow.TaintTracking +import semmle.code.cpp.dataflow.new.TaintTracking from RandomNumberEngineCreation createRandomNumberEngine, string seedSource where diff --git a/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected b/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected index 51ef13412c..1477f314ae 100644 --- a/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected +++ b/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected @@ -1,13 +1,11 @@ -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnPolymorphicObjects.ql:46,62-70) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnPolymorphicObjects.ql:47,22-30) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnPolymorphicObjects.ql:56,20-28) -WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotUsePointerArithmeticOnPolymorphicObjects.ql:62,3-11) edges | test.cpp:15:19:15:21 | foo | test.cpp:16:24:16:26 | foo | provenance | | | test.cpp:15:19:15:21 | foo | test.cpp:16:51:16:53 | foo | provenance | | | test.cpp:27:19:27:21 | foo | test.cpp:29:18:29:20 | foo | provenance | | +| test.cpp:40:12:40:19 | new | test.cpp:40:12:40:19 | new | provenance | | | test.cpp:40:12:40:19 | new | test.cpp:43:6:43:7 | l1 | provenance | | | test.cpp:40:12:40:19 | new | test.cpp:44:6:44:7 | l1 | provenance | | +| test.cpp:42:12:42:14 | & ... | test.cpp:42:12:42:14 | & ... | provenance | | | test.cpp:42:12:42:14 | & ... | test.cpp:45:6:45:7 | l3 | provenance | | | test.cpp:42:12:42:14 | & ... | test.cpp:46:6:46:7 | l3 | provenance | | | test.cpp:43:6:43:7 | l1 | test.cpp:15:19:15:21 | foo | provenance | | @@ -21,6 +19,8 @@ nodes | test.cpp:27:19:27:21 | foo | semmle.label | foo | | test.cpp:29:18:29:20 | foo | semmle.label | foo | | test.cpp:40:12:40:19 | new | semmle.label | new | +| test.cpp:40:12:40:19 | new | semmle.label | new | +| test.cpp:42:12:42:14 | & ... | semmle.label | & ... | | test.cpp:42:12:42:14 | & ... | semmle.label | & ... | | test.cpp:43:6:43:7 | l1 | semmle.label | l1 | | test.cpp:44:6:44:7 | l1 | semmle.label | l1 | diff --git a/cpp/cert/test/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.expected b/cpp/cert/test/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.expected index 606ccbff2b..0128221ffc 100644 --- a/cpp/cert/test/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.expected +++ b/cpp/cert/test/rules/MSC51-CPP/BadlySeededRandomNumberGenerator.expected @@ -1,4 +1,3 @@ -WARNING: module 'TaintTracking' has been deprecated and may be removed in future (BadlySeededRandomNumberGenerator.ql:42,7-20) | test.cpp:9:33:9:33 | call to linear_congruential_engine | Random number generator linear_congruential_engine is default-initialized and is therefore not properly seeded. | | test.cpp:10:30:10:31 | call to linear_congruential_engine | Random number generator linear_congruential_engine is default-initialized and is therefore not properly seeded. | | test.cpp:11:21:11:22 | call to linear_congruential_engine | Random number generator linear_congruential_engine is default-initialized and is therefore not properly seeded. | diff --git a/cpp/common/src/codingstandards/cpp/ConcurrencyNew.qll b/cpp/common/src/codingstandards/cpp/ConcurrencyNew.qll new file mode 100644 index 0000000000..37aea01889 --- /dev/null +++ b/cpp/common/src/codingstandards/cpp/ConcurrencyNew.qll @@ -0,0 +1,15 @@ +import cpp +import semmle.code.cpp.dataflow.new.TaintTracking +import codingstandards.cpp.concurrency.Atomic +import codingstandards.cpp.concurrency.CConditionOperation +import codingstandards.cpp.concurrency.ControlFlow +import codingstandards.cpp.concurrency.ConditionalWait +import codingstandards.cpp.concurrency.LockingOperationNew +import codingstandards.cpp.concurrency.LockProtectedControlFlow +import codingstandards.cpp.concurrency.MutexDestroyer +import codingstandards.cpp.concurrency.ThreadCreation +import codingstandards.cpp.concurrency.ThreadedFunction +import codingstandards.cpp.concurrency.ThreadDependentMutexNew +import codingstandards.cpp.concurrency.ThreadSpecificStorageNew +import codingstandards.cpp.concurrency.ThreadWaitDetach +import codingstandards.cpp.concurrency.Types diff --git a/cpp/common/src/codingstandards/cpp/FgetsErrorManagement.qll b/cpp/common/src/codingstandards/cpp/FgetsErrorManagement.qll index 026fd93045..807fca0da5 100644 --- a/cpp/common/src/codingstandards/cpp/FgetsErrorManagement.qll +++ b/cpp/common/src/codingstandards/cpp/FgetsErrorManagement.qll @@ -4,7 +4,7 @@ */ import cpp -private import semmle.code.cpp.dataflow.DataFlow +private import semmle.code.cpp.dataflow.new.DataFlow import semmle.code.cpp.controlflow.Guards /* diff --git a/cpp/common/src/codingstandards/cpp/Loops.qll b/cpp/common/src/codingstandards/cpp/Loops.qll index 1086355638..ddf99a50dd 100644 --- a/cpp/common/src/codingstandards/cpp/Loops.qll +++ b/cpp/common/src/codingstandards/cpp/Loops.qll @@ -339,7 +339,8 @@ predicate isInvalidLoop(ForStmt forLoop, string reason, Locatable reasonLocation isForLoopWithMulipleCounters(forLoop) and reason = "it uses multiple loop counters$@" and reasonLabel = "" and - reasonLocation.getLocation() instanceof UnknownExprLocation + reasonLocation instanceof File and + reasonLocation.getLocation() instanceof UnknownLocation or isForLoopWithFloatingPointCounters(forLoop, reasonLocation) and reason = "it uses a loop counter '$@' of type floating-point" and diff --git a/cpp/common/src/codingstandards/cpp/concurrency/LockingOperationNew.qll b/cpp/common/src/codingstandards/cpp/concurrency/LockingOperationNew.qll new file mode 100644 index 0000000000..114b569204 --- /dev/null +++ b/cpp/common/src/codingstandards/cpp/concurrency/LockingOperationNew.qll @@ -0,0 +1,235 @@ +import cpp +import semmle.code.cpp.dataflow.new.TaintTracking + +abstract class LockingOperation extends FunctionCall { + /** + * Returns the target of the lock underlying this RAII-style lock. + */ + abstract Variable getLock(); + + /** + * Returns the lock underlying this RAII-style lock. + */ + abstract Expr getLockExpr(); + + /** + * Holds if this is a lock operation + */ + abstract predicate isLock(); + + /** + * Holds if this is an unlock operation + */ + abstract predicate isUnlock(); + + /** + * Holds if this locking operation is really a locking operation within a + * designated locking operation. This library assumes the underlying locking + * operations are implemented correctly in that calling a `LockingOperation` + * results in the creation of a singular lock. + */ + predicate isLockingOperationWithinLockingOperation(LockingOperation inner) { + exists(LockingOperation outer | outer.getTarget() = inner.getEnclosingFunction()) + } +} + +/** + * Common base class providing an interface into function call + * based mutex locks. + */ +abstract class MutexFunctionCall extends LockingOperation { + abstract predicate isRecursive(); + + abstract predicate isSpeculativeLock(); + + abstract predicate unlocks(MutexFunctionCall fc); +} + +/** + * Models calls to various mutex types found in CPP. + */ +class CPPMutexFunctionCall extends MutexFunctionCall { + VariableAccess var; + + CPPMutexFunctionCall() { + getTarget() + .(MemberFunction) + .getDeclaringType() + .hasQualifiedName("std", + ["mutex", "timed_mutex", "shared_timed_mutex", "recursive_mutex", "recursive_timed_mutex"]) and + var = getQualifier() + } + + /** + * Holds if this mutex is a recursive mutex. + */ + override predicate isRecursive() { + getTarget() + .(MemberFunction) + .getDeclaringType() + .hasQualifiedName("std", ["recursive_mutex", "recursive_timed_mutex"]) + } + + /** + * Holds if this `CPPMutexFunctionCall` is a lock. + */ + override predicate isLock() { + not isLockingOperationWithinLockingOperation(this) and + getTarget().getName() = "lock" + } + + /** + * Holds if this `CPPMutexFunctionCall` is a speculative lock, defined as calling + * one of the speculative locking functions such as `try_lock`. + */ + override predicate isSpeculativeLock() { + getTarget().getName() in [ + "try_lock", "try_lock_for", "try_lock_until", "try_lock_shared_for", "try_lock_shared_until" + ] + } + + /** + * Returns the lock to which this `CPPMutexFunctionCall` refers to. + */ + override Variable getLock() { result = getQualifier().(VariableAccess).getTarget() } + + /** + * Returns the qualifier for this `CPPMutexFunctionCall`. + */ + override Expr getLockExpr() { result = var } + + /** + * Holds if this is a `unlock` and *may* unlock the previously locked `MutexFunctionCall`. + * This predicate does not check that the mutex is currently locked. + */ + override predicate unlocks(MutexFunctionCall fc) { + isUnlock() and + fc.getQualifier().(VariableAccess).getTarget() = getQualifier().(VariableAccess).getTarget() + } + + /** + * Holds if this is an unlock call. + */ + override predicate isUnlock() { getTarget().getName() = "unlock" } +} + +/** + * Models calls to various mutex types specialized to C code. + */ +class CMutexFunctionCall extends MutexFunctionCall { + Expr arg; + + CMutexFunctionCall() { + // the non recursive kinds + getTarget().getName() = ["mtx_lock", "mtx_unlock", "mtx_timedlock", "mtx_trylock"] and + arg = getArgument(0) + } + + /** + * Holds if this mutex is a recursive mutex. + */ + override predicate isRecursive() { none() } + + /** + * Holds if this `CMutexFunctionCall` is a lock. + */ + override predicate isLock() { + not isLockingOperationWithinLockingOperation(this) and + getTarget().getName() = ["mtx_lock", "mtx_timedlock", "mtx_trylock"] + } + + /** + * Holds if this `CMutexFunctionCall` is a speculative lock, defined as calling + * one of the speculative locking functions such as `try_lock`. + */ + override predicate isSpeculativeLock() { + getTarget().getName() in ["mtx_timedlock", "mtx_trylock"] + } + + /** + * Returns the `Variable` to which this `CMutexFunctionCall` refers to. For this + * style of lock it can reference a number of different variables. + */ + override Variable getLock() { + exists(VariableAccess va | + TaintTracking::localTaint(DataFlow::exprNode(va), DataFlow::exprNode(getLockExpr())) and + result = va.getTarget() + ) + } + + /** + * Returns the expression for this `CMutexFunctionCall`. + */ + override Expr getLockExpr() { result = arg } + + /** + * Holds if this is a `unlock` and *may* unlock the previously locked `CMutexFunctionCall`. + * This predicate does not check that the mutex is currently locked. + */ + override predicate unlocks(MutexFunctionCall fc) { + isUnlock() and + fc.getLock() = getLock() + } + + /** + * Holds if this is an unlock call. + */ + override predicate isUnlock() { getTarget().getName() = "mtx_unlock" } +} + +/** + * Models a RAII-Style lock. + */ +class RAIIStyleLock extends LockingOperation { + VariableAccess lock; + + RAIIStyleLock() { + ( + getTarget().getDeclaringType().hasQualifiedName("std", "lock_guard") or + getTarget().getDeclaringType().hasQualifiedName("std", "unique_lock") or + getTarget().getDeclaringType().hasQualifiedName("std", "scoped_lock") + ) and + ( + lock = getArgument(0).getAChild*() + or + this instanceof DestructorCall and + exists(RAIIStyleLock constructor | + constructor = getQualifier().(VariableAccess).getTarget().getInitializer().getExpr() and + lock = constructor.getArgument(0).getAChild*() + ) + ) + } + + /** + * Holds if this is a lock operation + */ + override predicate isLock() { + not isLockingOperationWithinLockingOperation(this) and + this instanceof ConstructorCall and + lock = getArgument(0).getAChild*() and + // defer_locks don't cause a lock + not exists(Expr exp | + exp = getArgument(1) and + exp.(VariableAccess) + .getTarget() + .getUnderlyingType() + .(Class) + .hasQualifiedName("std", "defer_lock_t") + ) + } + + /** + * Holds if this is an unlock operation + */ + override predicate isUnlock() { this instanceof DestructorCall } + + /** + * Returns the target of the lock underlying this RAII-style lock. + */ + override Variable getLock() { result = lock.getTarget() } + + /** + * Returns the lock underlying this RAII-style lock. + */ + override Expr getLockExpr() { result = lock } +} diff --git a/cpp/common/src/codingstandards/cpp/concurrency/ThreadDependentMutexNew.qll b/cpp/common/src/codingstandards/cpp/concurrency/ThreadDependentMutexNew.qll new file mode 100644 index 0000000000..c761e2b1be --- /dev/null +++ b/cpp/common/src/codingstandards/cpp/concurrency/ThreadDependentMutexNew.qll @@ -0,0 +1,246 @@ +import cpp +import semmle.code.cpp.dataflow.new.TaintTracking +private import codingstandards.cpp.concurrency.ControlFlow +private import codingstandards.cpp.concurrency.ThreadedFunction + +abstract class MutexSource extends FunctionCall { } + +/** + * Models a C++ style mutex. + */ +class CPPMutexSource extends MutexSource, ConstructorCall { + CPPMutexSource() { getTarget().getDeclaringType().hasQualifiedName("std", "mutex") } +} + +/** + * Models a C11 style mutex. + */ +class C11MutexSource extends MutexSource, FunctionCall { + C11MutexSource() { getTarget().hasName("mtx_init") } + + Expr getMutexExpr() { result = getArgument(0) } + + Expr getMutexTypeExpr() { result = getArgument(1) } + + predicate isRecursive() { + exists(EnumConstantAccess recursive | + recursive = getMutexTypeExpr().getAChild*() and + recursive.getTarget().hasName("mtx_recursive") + ) + } +} + +/** + * Models a thread dependent mutex. A thread dependent mutex is a mutex + * that is used by a thread. This dependency is established either by directly + * passing in a mutex or by referencing a mutex that is in the local scope. The utility + * of this class is it captures the `DataFlow::Node` source at which the mutex + * came from. For example, if it is passed in from a local function to a thread. + * This functionality is critical, since it allows one to inspect how the thread + * behaves with respect to the owner of a resource. + * + * To model the myriad ways this can happen, the subclasses of this class are + * responsible for implementing the various usage patterns. + */ +abstract class ThreadDependentMutex extends DataFlow::Node { + DataFlow::Node sink; + + DataFlow::Node getASource() { + // the source is either the thing that declared + // the mutex + result = this + or + // or the thread we are using it in + result = getAThreadSource() + } + + /** + * Gets the dataflow nodes corresponding to thread local usages of the + * dependent mutex. + */ + DataFlow::Node getAThreadSource() { + // here we line up the actual parameter at the thread creation + // site with the formal parameter in the target thread. + // Note that there are differences between the C and C++ versions + // of the argument ordering in the thread creation function. However, + // since the C version only takes one parameter (as opposed to multiple) + // we can simplify this search by considering only the first argument. + exists(FunctionCall fc, Function f, int n | + // Get the argument to which the mutex flowed. + fc.getArgument(n) = sink.asExpr() and + // Get the thread function we are calling. + f = fc.getArgument(0).(FunctionAccess).getTarget() and + // in C++, there is an extra argument to the `std::thread` call + // so we must subtract 1 since this is not passed to the thread. + ( + result = DataFlow::exprNode(f.getParameter(n - 1).getAnAccess()) + or + // In C, only one argument is allowed. Thus IF the flow predicate holds, + // it will be to the first argument + result = DataFlow::exprNode(f.getParameter(0).getAnAccess()) + ) + ) + } + + /** + * Produces the set of dataflow nodes to thread creation for threads + * that are dependent on this mutex. + */ + DataFlow::Node getADependentThreadCreationExpr() { + exists(FunctionCall fc | + fc.getAnArgument() = sink.asExpr() and + result = DataFlow::exprNode(fc) + ) + } + + /** + * Gets a set of usages of this mutex in both the local and thread scope. + * In the case of scoped usage, this also captures typical accesses of variables. + */ + DataFlow::Node getAUsage() { TaintTracking::localTaint(getASource(), result) } +} + +/** + * This class models the type of thread/mutex dependency that is established + * through the typical parameter passing mechanisms found in C++. + */ +class FlowBasedThreadDependentMutex extends ThreadDependentMutex { + FlowBasedThreadDependentMutex() { + // some sort of dataflow, likely through parameter passing. + ThreadDependentMutexFlow::flow(this, sink) + } +} + +/** + * This class models the type of thread/mutex dependency that is established by + * either scope based accesses (e.g., global variables) or block scope differences. + */ +class AccessBasedThreadDependentMutex extends ThreadDependentMutex { + Variable variableSource; + + AccessBasedThreadDependentMutex() { + // encapsulates usages from outside scopes not directly expressed + // in dataflow. + exists(MutexSource mutexSrc, ThreadedFunction f | + DataFlow::exprNode(mutexSrc) = this and + // find a variable that was assigned the mutex + TaintTracking::localTaint(DataFlow::exprNode(mutexSrc), + DataFlow::exprNode(variableSource.getAnAssignedValue())) and + // find all subsequent accesses of that variable that are within a + // function and set those to the sink + exists(VariableAccess va | + va = variableSource.getAnAccess() and + va.getEnclosingFunction() = f and + sink = DataFlow::exprNode(va) + ) + ) + } + + override DataFlow::Node getAUsage() { DataFlow::exprNode(variableSource.getAnAccess()) = result } +} + +/** + * In the typical C thread model, a mutex is a created by a function that is not responsible + * for creating the variable. Thus this class encodes a slightly different semantics + * wherein the usage pattern is that of variables that have been both initialized + * and then subsequently passed into a thread directly. + */ +class DeclarationInitBasedThreadDependentMutex extends ThreadDependentMutex { + Variable variableSource; + + DeclarationInitBasedThreadDependentMutex() { + exists(MutexSource ms, ThreadCreationFunction tcf | + this = DataFlow::exprNode(ms) and + // accessed as a mutex source + TaintTracking::localTaint(DataFlow::exprNode(variableSource.getAnAccess()), + DataFlow::exprNode(ms.getAnArgument())) and + // subsequently passed to a thread creation function (order not strictly + // enforced for performance reasons) + sink = DataFlow::exprNode(tcf.getAnArgument()) and + TaintTracking::localTaint(DataFlow::exprNode(variableSource.getAnAccess()), sink) + ) + } + + override DataFlow::Node getAUsage() { + TaintTracking::localTaint(getASource(), result) or + DataFlow::exprNode(variableSource.getAnAccess()) = result + } + + override DataFlow::Node getASource() { + // the source is either the thing that declared + // the mutex + result = this + or + // or the thread we are using it in + result = getAThreadSource() + } + + DataFlow::Node getSink() { result = sink } + + /** + * Gets the dataflow nodes corresponding to thread local usages of the + * dependent mutex. + */ + override DataFlow::Node getAThreadSource() { + // here we line up the actual parameter at the thread creation + // site with the formal parameter in the target thread. + // Note that there are differences between the C and C++ versions + // of the argument ordering in the thread creation function. However, + // since the C version only takes one parameter (as opposed to multiple) + // we can simplify this search by considering only the first argument. + exists( + FunctionCall fc, Function f, int n // CPP Version + | + fc.getArgument(n) = sink.asExpr() and + f = fc.getArgument(0).(FunctionAccess).getTarget() and + // in C++, there is an extra argument to the `std::thread` call + // so we must subtract 1 since this is not passed to the thread. + result = DataFlow::exprNode(f.getParameter(n - 1).getAnAccess()) + ) + or + exists( + FunctionCall fc, Function f // C Version + | + fc.getAnArgument() = sink.asExpr() and + // in C, the second argument is the function + f = fc.getArgument(1).(FunctionAccess).getTarget() and + // in C, the passed argument is always the zeroth argument + result = DataFlow::exprNode(f.getParameter(0).getAnAccess()) + ) + } +} + +/** + * In the typical C model, another way to use mutexes is to work with global variables + * that can be initialized at various points -- one of which must be inside a thread. + * This class encapsulates this pattern. + */ +class DeclarationInitAccessBasedThreadDependentMutex extends ThreadDependentMutex { + Variable variableSource; + + DeclarationInitAccessBasedThreadDependentMutex() { + exists(MutexSource ms, ThreadedFunction tf, VariableAccess va | + this = DataFlow::exprNode(ms) and + // accessed as a mutex source + TaintTracking::localTaint(DataFlow::exprNode(variableSource.getAnAccess()), + DataFlow::exprNode(ms.getAnArgument())) and + // is accessed somewhere else + va = variableSource.getAnAccess() and + sink = DataFlow::exprNode(va) and + // one of which must be a thread + va.getEnclosingFunction() = tf + ) + } + + override DataFlow::Node getAUsage() { result = DataFlow::exprNode(variableSource.getAnAccess()) } +} + +module ThreadDependentMutexConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node node) { node.asExpr() instanceof MutexSource } + + predicate isSink(DataFlow::Node node) { + exists(ThreadCreationFunction f | f.getAnArgument() = node.asExpr()) + } +} + +module ThreadDependentMutexFlow = TaintTracking::Global; diff --git a/cpp/common/src/codingstandards/cpp/concurrency/ThreadSpecificStorageNew.qll b/cpp/common/src/codingstandards/cpp/concurrency/ThreadSpecificStorageNew.qll new file mode 100644 index 0000000000..6dcb169250 --- /dev/null +++ b/cpp/common/src/codingstandards/cpp/concurrency/ThreadSpecificStorageNew.qll @@ -0,0 +1,59 @@ +import cpp +private import semmle.code.cpp.dataflow.new.DataFlow +private import codingstandards.cpp.concurrency.ThreadCreation + +/** + * Models calls to thread specific storage function calls. + */ +abstract class ThreadSpecificStorageFunctionCall extends FunctionCall { + /** + * Gets the key to which this call references. + */ + Expr getKey() { getArgument(0) = result } +} + +/** + * Models calls to `tss_get`. + */ +class TSSGetFunctionCall extends ThreadSpecificStorageFunctionCall { + TSSGetFunctionCall() { getTarget().getName() = "tss_get" } +} + +/** + * Models calls to `tss_set`. + */ +class TSSSetFunctionCall extends ThreadSpecificStorageFunctionCall { + TSSSetFunctionCall() { getTarget().getName() = "tss_set" } +} + +/** + * Models calls to `tss_create` + */ +class TSSCreateFunctionCall extends ThreadSpecificStorageFunctionCall { + TSSCreateFunctionCall() { getTarget().getName() = "tss_create" } + + predicate hasDeallocator() { + not exists(MacroInvocation mi, NullMacro nm | + getArgument(1) = mi.getExpr() and + mi = nm.getAnInvocation() + ) + } +} + +/** + * Models calls to `tss_delete` + */ +class TSSDeleteFunctionCall extends ThreadSpecificStorageFunctionCall { + TSSDeleteFunctionCall() { getTarget().getName() = "tss_delete" } +} + +/** + * Gets a call to `DeallocationExpr` that deallocates memory owned by thread specific + * storage. + */ +predicate getAThreadSpecificStorageDeallocationCall(C11ThreadCreateCall tcc, DeallocationExpr dexp) { + exists(TSSGetFunctionCall tsg | + tcc.getFunction().getEntryPoint().getASuccessor*() = tsg and + DataFlow::localFlow(DataFlow::exprNode(tsg), DataFlow::exprNode(dexp.getFreedExpr())) + ) +} diff --git a/cpp/common/src/codingstandards/cpp/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.qll b/cpp/common/src/codingstandards/cpp/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.qll index daab79e122..f9ac9cd5c6 100644 --- a/cpp/common/src/codingstandards/cpp/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.qll +++ b/cpp/common/src/codingstandards/cpp/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.qll @@ -7,7 +7,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow signature module DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeSharedConfigSig { Query getQuery(); diff --git a/cpp/common/src/codingstandards/cpp/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.qll b/cpp/common/src/codingstandards/cpp/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.qll index adb9785814..16f9638294 100644 --- a/cpp/common/src/codingstandards/cpp/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.qll +++ b/cpp/common/src/codingstandards/cpp/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow import ArrayToPointerDiffOperandFlow::PathGraph module ArrayToPointerDiffOperandConfig implements DataFlow::ConfigSig { @@ -25,6 +25,8 @@ module ArrayToPointerDiffOperandConfig implements DataFlow::ConfigSig { // Add a flow step from the base to the array expression to track pointers to elements of the array. exists(ArrayExpr e | e.getArrayBase() = pred.asExpr() and e = succ.asExpr()) } + + predicate isBarrierIn(DataFlow::Node node) { isSource(node) } } module ArrayToPointerDiffOperandFlow = DataFlow::Global; diff --git a/cpp/common/src/codingstandards/cpp/rules/guardaccesstobitfields/GuardAccessToBitFields.qll b/cpp/common/src/codingstandards/cpp/rules/guardaccesstobitfields/GuardAccessToBitFields.qll index 5b03a4f8bd..8bac7e15ee 100644 --- a/cpp/common/src/codingstandards/cpp/rules/guardaccesstobitfields/GuardAccessToBitFields.qll +++ b/cpp/common/src/codingstandards/cpp/rules/guardaccesstobitfields/GuardAccessToBitFields.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew abstract class GuardAccessToBitFieldsSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.qll b/cpp/common/src/codingstandards/cpp/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.qll index b26421c72c..b11050e491 100644 --- a/cpp/common/src/codingstandards/cpp/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.qll +++ b/cpp/common/src/codingstandards/cpp/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.qll @@ -5,7 +5,6 @@ */ import cpp -import semmle.code.cpp.dataflow.TaintTracking import codingstandards.cpp.Exclusions import codingstandards.cpp.standardlibrary.FileStreams import codingstandards.cpp.standardlibrary.FileAccess diff --git a/cpp/common/src/codingstandards/cpp/rules/joinordetachthreadonlyonce/JoinOrDetachThreadOnlyOnce.qll b/cpp/common/src/codingstandards/cpp/rules/joinordetachthreadonlyonce/JoinOrDetachThreadOnlyOnce.qll index 5ccbe83c72..4b09e85873 100644 --- a/cpp/common/src/codingstandards/cpp/rules/joinordetachthreadonlyonce/JoinOrDetachThreadOnlyOnce.qll +++ b/cpp/common/src/codingstandards/cpp/rules/joinordetachthreadonlyonce/JoinOrDetachThreadOnlyOnce.qll @@ -7,7 +7,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew abstract class JoinOrDetachThreadOnlyOnceSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll b/cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll index 966d6bcba3..8fe3a69076 100644 --- a/cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll +++ b/cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll @@ -8,7 +8,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import codingstandards.cpp.lifetimes.StorageDuration signature module PossibleDataRaceBetweenThreadsSharedConfigSig { diff --git a/cpp/common/src/codingstandards/cpp/rules/preservesafetywhenusingconditionvariables/PreserveSafetyWhenUsingConditionVariables.qll b/cpp/common/src/codingstandards/cpp/rules/preservesafetywhenusingconditionvariables/PreserveSafetyWhenUsingConditionVariables.qll index 94d9d201c4..0851fe980a 100644 --- a/cpp/common/src/codingstandards/cpp/rules/preservesafetywhenusingconditionvariables/PreserveSafetyWhenUsingConditionVariables.qll +++ b/cpp/common/src/codingstandards/cpp/rules/preservesafetywhenusingconditionvariables/PreserveSafetyWhenUsingConditionVariables.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew abstract class PreserveSafetyWhenUsingConditionVariablesSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/preventdeadlockbylockinginpredefinedorder/PreventDeadlockByLockingInPredefinedOrder.qll b/cpp/common/src/codingstandards/cpp/rules/preventdeadlockbylockinginpredefinedorder/PreventDeadlockByLockingInPredefinedOrder.qll index db755293c6..25e169b139 100644 --- a/cpp/common/src/codingstandards/cpp/rules/preventdeadlockbylockinginpredefinedorder/PreventDeadlockByLockingInPredefinedOrder.qll +++ b/cpp/common/src/codingstandards/cpp/rules/preventdeadlockbylockinginpredefinedorder/PreventDeadlockByLockingInPredefinedOrder.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew import semmle.code.cpp.controlflow.Dominance abstract class PreventDeadlockByLockingInPredefinedOrderSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.qll b/cpp/common/src/codingstandards/cpp/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.qll index fd56f5d899..cb0bc765e6 100644 --- a/cpp/common/src/codingstandards/cpp/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.qll +++ b/cpp/common/src/codingstandards/cpp/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.qll @@ -7,7 +7,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions import semmle.code.cpp.valuenumbering.GlobalValueNumbering -import semmle.code.cpp.dataflow.TaintTracking +import semmle.code.cpp.dataflow.new.TaintTracking import codingstandards.cpp.standardlibrary.CharStreams abstract class StringNumberConversionMissingErrorCheckSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/useonlyarrayindexingforpointerarithmetic/UseOnlyArrayIndexingForPointerArithmetic.qll b/cpp/common/src/codingstandards/cpp/rules/useonlyarrayindexingforpointerarithmetic/UseOnlyArrayIndexingForPointerArithmetic.qll index 3b0abbad0d..f9ffb4fc9a 100644 --- a/cpp/common/src/codingstandards/cpp/rules/useonlyarrayindexingforpointerarithmetic/UseOnlyArrayIndexingForPointerArithmetic.qll +++ b/cpp/common/src/codingstandards/cpp/rules/useonlyarrayindexingforpointerarithmetic/UseOnlyArrayIndexingForPointerArithmetic.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import semmle.code.cpp.dataflow.DataFlow +import semmle.code.cpp.dataflow.new.DataFlow abstract class UseOnlyArrayIndexingForPointerArithmeticSharedQuery extends Query { } diff --git a/cpp/common/src/codingstandards/cpp/rules/wrapspuriousfunctioninloop/WrapSpuriousFunctionInLoop.qll b/cpp/common/src/codingstandards/cpp/rules/wrapspuriousfunctioninloop/WrapSpuriousFunctionInLoop.qll index 99bdbeee5d..382cda1ae8 100644 --- a/cpp/common/src/codingstandards/cpp/rules/wrapspuriousfunctioninloop/WrapSpuriousFunctionInLoop.qll +++ b/cpp/common/src/codingstandards/cpp/rules/wrapspuriousfunctioninloop/WrapSpuriousFunctionInLoop.qll @@ -6,7 +6,7 @@ import cpp import codingstandards.cpp.Customizations import codingstandards.cpp.Exclusions -import codingstandards.cpp.Concurrency +import codingstandards.cpp.ConcurrencyNew abstract class WrapSpuriousFunctionInLoopSharedQuery extends Query { } diff --git a/cpp/common/test/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.expected b/cpp/common/test/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.expected index 920d940957..4ccfd67434 100644 --- a/cpp/common/test/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.expected +++ b/cpp/common/test/rules/donotdeleteanarraythroughapointeroftheincorrecttypeshared/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectTypeShared.expected @@ -1,10 +1,14 @@ problems | test.cpp:9:12:9:13 | l1 | test.cpp:6:19:6:37 | new[] | test.cpp:9:12:9:13 | l1 | Array of type 'DerivedClass *' is deleted through a pointer of type 'BaseClass *'. | edges +| test.cpp:6:19:6:37 | new[] | test.cpp:6:19:6:37 | new[] | provenance | | | test.cpp:6:19:6:37 | new[] | test.cpp:9:12:9:13 | l1 | provenance | | +| test.cpp:7:22:7:40 | new[] | test.cpp:7:22:7:40 | new[] | provenance | | | test.cpp:7:22:7:40 | new[] | test.cpp:10:12:10:13 | l2 | provenance | | nodes | test.cpp:6:19:6:37 | new[] | semmle.label | new[] | +| test.cpp:6:19:6:37 | new[] | semmle.label | new[] | +| test.cpp:7:22:7:40 | new[] | semmle.label | new[] | | test.cpp:7:22:7:40 | new[] | semmle.label | new[] | | test.cpp:9:12:9:13 | l1 | semmle.label | l1 | | test.cpp:10:12:10:13 | l2 | semmle.label | l2 | diff --git a/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected b/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected index 2d293e6928..89f6cec56a 100644 --- a/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected +++ b/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected @@ -4,19 +4,27 @@ problems | test.cpp:13:10:13:11 | p4 | test.cpp:5:14:5:15 | l2 | test.cpp:13:10:13:11 | p4 | Subtraction between left operand pointing to array $@ and other operand pointing to array $@. | test.cpp:3:7:3:8 | l2 | l2 | test.cpp:2:7:2:8 | l1 | l1 | | test.cpp:13:15:13:16 | l1 | test.cpp:13:15:13:16 | l1 | test.cpp:13:15:13:16 | l1 | Subtraction between right operand pointing to array $@ and other operand pointing to array $@. | test.cpp:2:7:2:8 | l1 | l1 | test.cpp:3:7:3:8 | l2 | l2 | edges -| test.cpp:4:14:4:15 | l1 | test.cpp:4:14:4:18 | access to array | provenance | Config | -| test.cpp:4:14:4:18 | access to array | test.cpp:10:10:10:11 | p1 | provenance | | -| test.cpp:4:14:4:18 | access to array | test.cpp:12:10:12:11 | p1 | provenance | | -| test.cpp:5:14:5:15 | l2 | test.cpp:5:14:5:19 | access to array | provenance | Config | -| test.cpp:5:14:5:19 | access to array | test.cpp:11:10:11:11 | p2 | provenance | | -| test.cpp:5:14:5:19 | access to array | test.cpp:12:15:12:16 | p2 | provenance | | -| test.cpp:5:14:5:19 | access to array | test.cpp:13:10:13:11 | p4 | provenance | | -| test.cpp:5:14:5:19 | access to array | test.cpp:14:10:14:11 | p4 | provenance | | +| test.cpp:4:13:4:18 | & ... | test.cpp:4:13:4:18 | & ... | provenance | | +| test.cpp:4:13:4:18 | & ... | test.cpp:10:10:10:11 | p1 | provenance | | +| test.cpp:4:13:4:18 | & ... | test.cpp:12:10:12:11 | p1 | provenance | | +| test.cpp:4:14:4:15 | l1 | test.cpp:4:13:4:18 | & ... | provenance | Config | +| test.cpp:5:13:5:19 | & ... | test.cpp:5:13:5:19 | & ... | provenance | | +| test.cpp:5:13:5:19 | & ... | test.cpp:6:13:6:14 | p2 | provenance | | +| test.cpp:5:13:5:19 | & ... | test.cpp:11:10:11:11 | p2 | provenance | | +| test.cpp:5:13:5:19 | & ... | test.cpp:12:15:12:16 | p2 | provenance | | +| test.cpp:5:14:5:15 | l2 | test.cpp:5:13:5:19 | & ... | provenance | Config | +| test.cpp:6:13:6:14 | p2 | test.cpp:7:13:7:14 | p3 | provenance | | +| test.cpp:7:13:7:14 | p3 | test.cpp:13:10:13:11 | p4 | provenance | | +| test.cpp:7:13:7:14 | p3 | test.cpp:14:10:14:11 | p4 | provenance | | nodes +| test.cpp:4:13:4:18 | & ... | semmle.label | & ... | +| test.cpp:4:13:4:18 | & ... | semmle.label | & ... | | test.cpp:4:14:4:15 | l1 | semmle.label | l1 | -| test.cpp:4:14:4:18 | access to array | semmle.label | access to array | +| test.cpp:5:13:5:19 | & ... | semmle.label | & ... | +| test.cpp:5:13:5:19 | & ... | semmle.label | & ... | | test.cpp:5:14:5:15 | l2 | semmle.label | l2 | -| test.cpp:5:14:5:19 | access to array | semmle.label | access to array | +| test.cpp:6:13:6:14 | p2 | semmle.label | p2 | +| test.cpp:7:13:7:14 | p3 | semmle.label | p3 | | test.cpp:10:10:10:11 | p1 | semmle.label | p1 | | test.cpp:10:15:10:16 | l1 | semmle.label | l1 | | test.cpp:11:10:11:11 | p2 | semmle.label | p2 | diff --git a/cpp/common/test/rules/usecanonicalorderformemberinit/UseCanonicalOrderForMemberInit.expected b/cpp/common/test/rules/usecanonicalorderformemberinit/UseCanonicalOrderForMemberInit.expected index d74c29ed83..bff253bc38 100644 --- a/cpp/common/test/rules/usecanonicalorderformemberinit/UseCanonicalOrderForMemberInit.expected +++ b/cpp/common/test/rules/usecanonicalorderformemberinit/UseCanonicalOrderForMemberInit.expected @@ -1,13 +1,13 @@ -| test.cpp:7:30:7:36 | (no string representation) | The initializer Base1(...) for $@ in the constructor DirectDerived(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:2:7:2:11 | Base1 | class Base1 | test.cpp:3:7:3:11 | Base2 | class Base2 | test.cpp:7:21:7:27 | (no string representation) | Base2(...) | -| test.cpp:8:45:8:51 | (no string representation) | The initializer Base2(...) for $@ in the constructor DirectDerived(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:3:7:3:11 | Base2 | class Base2 | test.cpp:4:7:4:11 | Base3 | class Base3 | test.cpp:8:27:8:33 | (no string representation) | Base3(...) | +| test.cpp:7:30:7:36 | constructor init | The initializer Base1(...) for $@ in the constructor DirectDerived(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:2:7:2:11 | Base1 | class Base1 | test.cpp:3:7:3:11 | Base2 | class Base2 | test.cpp:7:21:7:27 | constructor init | Base2(...) | +| test.cpp:8:45:8:51 | constructor init | The initializer Base2(...) for $@ in the constructor DirectDerived(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:3:7:3:11 | Base2 | class Base2 | test.cpp:4:7:4:11 | Base3 | class Base3 | test.cpp:8:27:8:33 | constructor init | Base3(...) | | test.cpp:27:38:27:41 | constructor init of field u1 | The initializer u1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:16:9:16:10 | u1 | field u1 | test.cpp:22:7:22:8 | i2 | field i2 | test.cpp:27:32:27:35 | constructor init of field i2 | i2(...) | | test.cpp:27:44:27:47 | constructor init of field i1 | The initializer i1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:14:7:14:8 | i1 | field i1 | test.cpp:16:9:16:10 | u1 | field u1 | test.cpp:27:38:27:41 | constructor init of field u1 | u1(...) | | test.cpp:28:43:28:46 | constructor init of field l1 | The initializer l1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:18:12:18:13 | l1 | field l1 | test.cpp:22:7:22:8 | i2 | field i2 | test.cpp:28:37:28:40 | constructor init of field i2 | i2(...) | | test.cpp:28:49:28:52 | constructor init of field i1 | The initializer i1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:14:7:14:8 | i1 | field i1 | test.cpp:18:12:18:13 | l1 | field l1 | test.cpp:28:43:28:46 | constructor init of field l1 | l1(...) | | test.cpp:29:48:29:51 | constructor init of field d1 | The initializer d1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:19:14:19:15 | d1 | field d1 | test.cpp:22:7:22:8 | i2 | field i2 | test.cpp:29:42:29:45 | constructor init of field i2 | i2(...) | | test.cpp:29:54:29:57 | constructor init of field i1 | The initializer i1(...) for $@ in the constructor MemberOrder(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:14:7:14:8 | i1 | field i1 | test.cpp:19:14:19:15 | d1 | field d1 | test.cpp:29:48:29:51 | constructor init of field d1 | d1(...) | -| test.cpp:48:9:48:27 | (no string representation) | The initializer VirtualBaseClass1(...) for $@ in the constructor Derived3(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:32:7:32:23 | VirtualBaseClass1 | class VirtualBaseClass1 | test.cpp:33:7:33:23 | VirtualBaseClass2 | class VirtualBaseClass2 | test.cpp:47:30:47:48 | (no string representation) | VirtualBaseClass2(...) | -| test.cpp:53:9:53:27 | (no string representation) | The initializer VirtualBaseClass2(...) for $@ in the constructor Derived3(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:33:7:33:23 | VirtualBaseClass2 | class VirtualBaseClass2 | test.cpp:36:7:36:14 | Derived1 | class Derived1 | test.cpp:51:9:51:18 | call to Derived1 | Derived1(...) | -| test.cpp:63:29:63:46 | (no string representation) | The initializer MixedVirtualBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:57:7:57:22 | MixedVirtualBase | class MixedVirtualBase | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:63:16:63:26 | (no string representation) | MixedBase(...) | -| test.cpp:64:28:64:38 | (no string representation) | The initializer MixedBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:61:7:61:9 | m_i | field m_i | test.cpp:64:21:64:25 | constructor init of field m_i | m_i(...) | -| test.cpp:64:41:64:58 | (no string representation) | The initializer MixedVirtualBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:57:7:57:22 | MixedVirtualBase | class MixedVirtualBase | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:64:28:64:38 | (no string representation) | MixedBase(...) | +| test.cpp:48:9:48:27 | constructor init | The initializer VirtualBaseClass1(...) for $@ in the constructor Derived3(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:32:7:32:23 | VirtualBaseClass1 | class VirtualBaseClass1 | test.cpp:33:7:33:23 | VirtualBaseClass2 | class VirtualBaseClass2 | test.cpp:47:30:47:48 | constructor init | VirtualBaseClass2(...) | +| test.cpp:53:9:53:27 | constructor init | The initializer VirtualBaseClass2(...) for $@ in the constructor Derived3(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:33:7:33:23 | VirtualBaseClass2 | class VirtualBaseClass2 | test.cpp:36:7:36:14 | Derived1 | class Derived1 | test.cpp:51:9:51:18 | call to Derived1 | Derived1(...) | +| test.cpp:63:29:63:46 | constructor init | The initializer MixedVirtualBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:57:7:57:22 | MixedVirtualBase | class MixedVirtualBase | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:63:16:63:26 | constructor init | MixedBase(...) | +| test.cpp:64:28:64:38 | constructor init | The initializer MixedBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:61:7:61:9 | m_i | field m_i | test.cpp:64:21:64:25 | constructor init of field m_i | m_i(...) | +| test.cpp:64:41:64:58 | constructor init | The initializer MixedVirtualBase(...) for $@ in the constructor Mixed(...) is initialized before $@, but appears after $@ in the initialization list. | test.cpp:57:7:57:22 | MixedVirtualBase | class MixedVirtualBase | test.cpp:56:7:56:15 | MixedBase | class MixedBase | test.cpp:64:28:64:38 | constructor init | MixedBase(...) |