Skip to content

Commit c0ff962

Browse files
committed
Merge commit 'fddf627461e88c0a824b36b770497be3a370eb3d' into codeql/upgrade-to-2.13.5
2 parents a1a47cc + fddf627 commit c0ff962

File tree

23 files changed

+46
-47
lines changed

23 files changed

+46
-47
lines changed

c/cert/src/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ Type compatibleTypes(Type type) {
163163
(
164164
type.stripType() instanceof Struct and
165165
type.getUnspecifiedType() = result.getUnspecifiedType() and
166-
not type.getName() = "struct <unnamed>" and
167-
not result.getName() = "struct <unnamed>"
166+
not type.(Struct).isAnonymous() and
167+
not result.(Struct).isAnonymous()
168168
or
169169
not type.stripType() instanceof Struct and
170170
(

c/cert/src/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module TaintedPathConfiguration implements DataFlow::ConfigSig {
8989
}
9090
}
9191

92-
module TaintedPath = TaintTracking::Make<TaintedPathConfiguration>;
92+
module TaintedPath = TaintTracking::Global<TaintedPathConfiguration>;
9393

9494
from
9595
FileFunction fileFunction, Expr taintedArg, FlowSource taintSource,
@@ -98,7 +98,7 @@ where
9898
not isExcluded(taintedArg, IO3Package::doNotPerformFileOperationsOnDevicesQuery()) and
9999
taintedArg = sinkNode.getNode().asIndirectArgument() and
100100
fileFunction.outermostWrapperFunctionCall(taintedArg, callChain) and
101-
TaintedPath::hasFlowPath(sourceNode, sinkNode) and
101+
TaintedPath::flowPath(sourceNode, sinkNode) and
102102
taintSource = sourceNode.getNode()
103103
select taintedArg, sourceNode, sinkNode,
104104
"This argument to a file access function is derived from $@ and then passed to " + callChain + ".",

c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ subpaths
5353
| test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | Cast from short[2] to short[4] results in an incompatible pointer base type. |
5454
| test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | Cast from char to signed char results in an incompatible pointer base type. |
5555
| test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | Cast from int to unsigned int results in an incompatible pointer base type. |
56-
| test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | Cast from struct <unnamed> to struct <unnamed> results in an incompatible pointer base type. |
57-
| test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | Cast from S1 to struct <unnamed> results in an incompatible pointer base type. |
58-
| test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | Cast from struct <unnamed> to S1 results in an incompatible pointer base type. |
56+
| test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | Cast from (unnamed class/struct/union) to (unnamed class/struct/union) results in an incompatible pointer base type. |
57+
| test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | Cast from S1 to (unnamed class/struct/union) results in an incompatible pointer base type. |
58+
| test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | Cast from (unnamed class/struct/union) to S1 results in an incompatible pointer base type. |
5959
| test.c:68:41:68:41 | v | test.c:72:13:72:15 | & ... | test.c:68:41:68:41 | v | Cast from float to int results in an incompatible pointer base type. |
6060
| test.c:99:3:99:4 | s3 | test.c:98:40:98:41 | s2 | test.c:99:3:99:4 | s3 | Cast from S2 to S3 results in an incompatible pointer base type. |

c/common/test/rules/informationleakageacrossboundaries/InformationLeakageAcrossBoundaries.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| interprocedural.c:104:9:104:9 | p | 'p' may leak information from {x (interprocedural.c:7), y (interprocedural.c:8)}. Path: p (interprocedural.c:104) --> overwrite_after_leak(...) (interprocedural.c:96) --> p (interprocedural.c:97) |
66
| multilayer.c:16:10:16:10 | s | 's' may leak information from {b (multilayer.c:12)}. Path: s (multilayer.c:16) --> & ... (multilayer.c:18) |
77
| multilayer.c:29:10:29:10 | s | 's' may leak information from {b (multilayer.c:12), x (multilayer.c:7)}. Path: s (multilayer.c:29) --> & ... (multilayer.c:30) |
8-
| multilayer.c:34:8:34:8 | s | 's' may leak information from {struct <unnamed> (multilayer.c:6)}. Path: s (multilayer.c:34) --> & ... (multilayer.c:35) |
8+
| multilayer.c:34:8:34:8 | s | 's' may leak information from {(unnamed class/struct/union) (multilayer.c:6)}. Path: s (multilayer.c:34) --> & ... (multilayer.c:35) |
99
| test.c:12:12:12:12 | s | 's' may leak information from {y (test.c:8)}. Path: s (test.c:12) --> & ... (test.c:14) |
1010
| test.c:18:12:18:12 | s | 's' may leak information from {x (test.c:7)}. Path: s (test.c:18) --> & ... (test.c:20) |
1111
| test.c:24:12:24:12 | s | 's' may leak information from {x (test.c:7), y (test.c:8)}. Path: s (test.c:24) --> & ... (test.c:25) |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
| test.c:4:8:4:8 | A | Type declaration A is not used. |
22
| test.c:7:18:7:18 | D | Type declaration D is not used. |
33
| test.c:28:11:28:11 | R | Type declaration R is not used. |
4-
| test.c:41:12:41:12 | struct <unnamed> | Type declaration struct <unnamed> is not used. |
4+
| test.c:41:12:41:12 | (unnamed class/struct/union) | Type declaration (unnamed class/struct/union) is not used. |

c/common/test/rules/useinitializerbracestomatchaggregatetypestructure/UseInitializerBracesToMatchAggregateTypeStructure.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
| test.c:35:32:35:35 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 2 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:35:18:35:42 | {...} | array of type int[4][2] |
44
| test.c:35:38:35:41 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 3 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:35:18:35:42 | {...} | array of type int[4][2] |
55
| test.c:41:34:41:34 | {...} | Missing braces on aggregate literal of type int[2]$@ which is assigned to index 1 in $@. | file://:0:0:0:0 | int[2] | int[2] | test.c:41:18:41:35 | {...} | array of type int[2][2] |
6-
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:4:10:4:10 | struct <unnamed> | struct <unnamed> | test.c:7:5:7:8 | m_s1 | m_s1 |
7-
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:11:10:11:10 | struct <unnamed> | struct <unnamed> | test.c:7:5:7:8 | m_s1 | m_s1 |
6+
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:4:10:4:10 | (unnamed class/struct/union) | (unnamed class/struct/union) | test.c:7:5:7:8 | m_s1 | m_s1 |
7+
| test.c:47:26:47:29 | {...} | Missing braces on aggregate literal of type $@ which is assigned to field $@. | test.c:11:10:11:10 | (unnamed class/struct/union) | (unnamed class/struct/union) | test.c:7:5:7:8 | m_s1 | m_s1 |

c/misra/src/codingstandards/c/misra/EssentialTypes.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ predicate isAssignmentToEssentialType(Type lValueEssentialType, Expr rValue) {
404404
// Initializing an array
405405
exists(ArrayAggregateLiteral aal |
406406
lValueEssentialType = aal.getElementType() and
407-
rValue = aal.getElementExpr(_)
407+
rValue = aal.getAnElementExpr(_)
408408
)
409409
or
410410
// Initializing a struct or union
411411
exists(ClassAggregateLiteral cal, Field field |
412412
lValueEssentialType = field.getType() and
413-
rValue = cal.getFieldExpr(field)
413+
rValue = cal.getAFieldExpr(field)
414414
)
415415
}

c/misra/src/rules/RULE-13-1/InitializerListsContainPersistentSideEffects.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ from AggregateLiteral initList, SideEffect effect
2525
where
2626
not isExcluded(initList, SideEffects1Package::initializerListsContainPersistentSideEffectsQuery()) and
2727
(
28-
initList.(ArrayOrVectorAggregateLiteral).getElementExpr(_) = effect
28+
initList.(ArrayOrVectorAggregateLiteral).getAnElementExpr(_) = effect
2929
or
30-
initList.(ClassAggregateLiteral).getFieldExpr(_) = effect
30+
initList.(ClassAggregateLiteral).getAFieldExpr(_) = effect
3131
)
3232
select initList, "Initializer list constains persistent $@", effect, "side effect"

c/misra/src/rules/RULE-2-4/UnusedTagDeclaration.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ from UserType s
2020
where
2121
not isExcluded(s, DeadCodePackage::unusedTagDeclarationQuery()) and
2222
// ignore structs without a tag name
23-
not s.getName() = "struct <unnamed>" and
23+
not s.isAnonymous() and
2424
// typedefs do not have a "tag" name, so this rule does not apply to them
2525
not s instanceof TypedefType and
2626
// Not mentioned anywhere

c/misra/src/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NullTerminatedStringToMemcmpConfiguration extends TaintTracking::Configura
3030
// The array element type is an essentially character type
3131
getEssentialTypeCategory(aal.getElementType()) = EssentiallyCharacterType() and
3232
// Includes a null terminator somewhere in the array initializer
33-
aal.getElementExpr(_).getValue().toInt() = 0
33+
aal.getAnElementExpr(_).getValue().toInt() = 0
3434
|
3535
// For local variables, use the array aggregate literal as the source
3636
aal = source.asExpr()

0 commit comments

Comments
 (0)