File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
cpp/ql/lib/semmle/code/cpp/commons Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,12 @@ private int isSource(Expr bufferExpr, Element why) {
106
106
exists ( Variable bufferVar | bufferVar = bufferExpr .( VariableAccess ) .getTarget ( ) |
107
107
// buffer is a fixed size array
108
108
exists ( bufferVar .getUnspecifiedType ( ) .( ArrayType ) .getSize ( ) ) and
109
- result = getSize ( bufferExpr ) and // more generous than .getSize() itself, when the array is a class field or similar.
109
+ result =
110
+ unique( int size | // more generous than .getSize() itself, when the array is a class field or similar.
111
+ size = getSize ( bufferExpr )
112
+ |
113
+ size
114
+ ) and
110
115
why = bufferVar and
111
116
not memberMayBeVarSize ( _, bufferVar ) and
112
117
not exists ( BuiltInOperationBuiltInOffsetOf offsetof | offsetof .getAChild * ( ) = bufferExpr ) and
You can’t perform that action at this time.
0 commit comments