Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent beb21f9 commit fe6c9f9Copy full SHA for fe6c9f9
1 file changed
cpp/ql/src/semmle/code/cpp/commons/Buffer.qll
@@ -80,13 +80,15 @@ int getBufferSize(Expr bufferExpr, Element why) {
80
// buffer is a fixed size dynamic allocation
81
isFixedSizeAllocationExpr(bufferExpr, result) and
82
why = bufferExpr
83
- ) or exists(Expr def, Element why2 |
+ ) or forex(Expr def |
84
// dataflow
85
- DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) and
86
- result = getBufferSize(def, why2) and
87
- (
88
- why = def or
89
- why = why2
+ DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) |
+ exists(Element why2 |
+ result = getBufferSize(def, why2) and
+ (
+ why = def or
90
+ why = why2
91
+ )
92
)
93
) or exists(Type bufferType |
94
// buffer is the address of a variable
0 commit comments