Skip to content

Commit 2f91e33

Browse files
author
Nikita Kraiouchkine
committed
EXP43-C: Refactor and remove test code
Remove an accidental `isBarrier` predicate left in from development
1 parent 46abe38 commit 2f91e33

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

c/cert/src/rules/EXP43-C/DoNotPassAliasedPointerToRestrictQualifiedParam.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ class PointerValueToRestrictArgConfig extends DataFlow::Configuration {
115115
}
116116

117117
from
118-
CallToFunctionWithRestrictParameters call, CallToFunctionWithRestrictParametersArgExpr arg1,
118+
PointerValueToRestrictArgConfig config, CallToFunctionWithRestrictParameters call,
119+
CallToFunctionWithRestrictParametersArgExpr arg1,
119120
CallToFunctionWithRestrictParametersArgExpr arg2, int argOffset1, int argOffset2, Expr source1,
120121
Expr source2, string sourceMessage1, string sourceMessage2
121122
where
@@ -124,8 +125,8 @@ where
124125
arg2 = call.getAPtrArg(_) and
125126
// enforce ordering to remove permutations if multiple restrict-qualified args exist
126127
(not arg2 = call.getARestrictPtrArg() or arg2.getParamIndex() > arg1.getParamIndex()) and
127-
// check if two pointers address the same object
128-
exists(PointerValueToRestrictArgConfig config |
128+
(
129+
// check if two pointers address the same object
129130
config.hasFlow(DataFlow::exprNode(source1), DataFlow::exprNode(arg1.getAChild*())) and
130131
(
131132
// one pointer value flows to both args

c/cert/src/rules/EXP43-C/RestrictPointerReferencesOverlappingObject.ql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ class AssignedValueToRestrictPtrValueConfiguration extends DataFlow::Configurati
5151
override predicate isSink(DataFlow::Node sink) {
5252
sink.asExpr() instanceof AssignmentOrInitializationToRestrictPtrValueExpr
5353
}
54-
55-
override predicate isBarrierIn(DataFlow::Node node) {
56-
isSource(node)
57-
}
5854
}
5955

6056
from

0 commit comments

Comments
 (0)