Skip to content

Commit c0f9767

Browse files
author
Nikita Kraiouchkine
committed
Update DoNotAccessVariableViaPointerOfIncompatibleType.ql
1 parent 87d52ae commit c0f9767

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @description Modifying underlying pointer data through a pointer of an incompatible type can lead
55
* to unpredictable results.
66
* @kind path-problem
7-
* @precision very-high
7+
* @precision high
88
* @problem.severity error
99
* @tags external/cert/id/exp39-c
1010
* correctness
@@ -191,7 +191,8 @@ Type compatibleTypes(Type type) {
191191

192192
from DataFlow::PathNode source, DataFlow::PathNode sink, Cast cast, Type fromType, Type toType
193193
where
194-
not isExcluded(cast, Pointers3Package::doNotAccessVariableViaPointerOfIncompatibleTypeQuery()) and
194+
not isExcluded(sink.getNode().asExpr(),
195+
Pointers3Package::doNotAccessVariableViaPointerOfIncompatibleTypeQuery()) and
195196
cast.getFile().compiledAsC() and
196197
any(IndirectCastConfiguration config).hasFlowPath(source, sink) and
197198
// include only sinks which are not a compatible type to the associated source

0 commit comments

Comments
 (0)