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 628540c commit c747f24Copy full SHA for c747f24
1 file changed
cpp/ql/src/semmle/code/cpp/commons/Buffer.qll
@@ -58,6 +58,10 @@ int getBufferSize(Expr bufferExpr, Element why) {
58
// buffer is an initialized array
59
// e.g. int buffer[] = {1, 2, 3};
60
why = bufferVar.getInitializer().getExpr() and
61
+ (
62
+ why instanceof AggregateLiteral or
63
+ why instanceof StringLiteral
64
+ ) and
65
result = why.(Expr).getType().(ArrayType).getSize() and
66
not exists(bufferVar.getType().getUnspecifiedType().(ArrayType).getSize())
67
) or exists(Class parentClass, VariableAccess parentPtr |
0 commit comments