Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9f0911

Browse files
authored
Merge pull request#473 from jketema/flowstate-fix
Use an IPA type for flow states
2 parentsbce37ac +8d026b0 commitd9f0911

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,24 @@ class ReallocationFunction extends AllocationFunction {
4242
ReallocationFunction(){exists(this.getReallocPtrArg())}
4343
}
4444

45-
/**
46-
* A data-flow state for a pointer which has not been reallocated.
47-
*/
48-
classIndirectCastDefaultFlowStateextends DataFlow::FlowState{
49-
IndirectCastDefaultFlowState(){this="IndirectCastDefaultFlowState"}
50-
}
51-
52-
/**
53-
* A data-flow state for a pointer which has been reallocated but
54-
* has not yet been zeroed with a memset call.
55-
*/
56-
classIndirectCastReallocatedFlowStateextends DataFlow::FlowState{
57-
IndirectCastReallocatedFlowState(){this="IndirectCastReallocatedFlowState"}
58-
}
45+
newtypeIndirectCastFlowState=
46+
/**
47+
* A data-flow state for a pointer which has not been reallocated.
48+
*/
49+
IndirectCastDefaultFlowState()or
50+
/**
51+
* A data-flow state for a pointer which has been reallocated but
52+
* has not yet been zeroed with a memset call.
53+
*/
54+
IndirectCastReallocatedFlowState()
5955

6056
/**
6157
* A data-flow configuration to track the flow from cast expressions to either
6258
* other cast expressions or to dereferences of pointers reallocated with a call
6359
* to `realloc` but not cleared via a function call to `memset`.
6460
*/
6561
module IndirectCastConfigimplements DataFlow::StateConfigSig{
66-
classFlowState=DataFlow::FlowState;
62+
classFlowState=IndirectCastFlowState;
6763

6864
predicateisSource(DataFlow::Nodesource,FlowStatestate){
6965
stateinstanceofIndirectCastDefaultFlowStateand

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp