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 ef8ca5d commit beb21f9Copy full SHA for beb21f9
1 file changed
cpp/ql/src/semmle/code/cpp/commons/Buffer.qll
@@ -77,10 +77,11 @@ int getBufferSize(Expr bufferExpr, Element why) {
77
parentClass.getSize()
78
)
79
) or (
80
- // buffer is assigned with an allocation
81
- DataFlow::localFlowStep(DataFlow::exprNode(why), DataFlow::exprNode(bufferExpr)) and
82
- isFixedSizeAllocationExpr(why, result)
+ // buffer is a fixed size dynamic allocation
+ isFixedSizeAllocationExpr(bufferExpr, result) and
+ why = bufferExpr
83
) or exists(Expr def, Element why2 |
84
+ // dataflow
85
DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) and
86
result = getBufferSize(def, why2) and
87
(
0 commit comments