Skip to content

Commit ba982e2

Browse files
authored
Merge pull request github#12752 from gsingh93/buffer-access-array-expr
C++: Consider ArrayExpr with non-constant size expressions as a BufferAccess
2 parents 4bca951 + 56dc2a4 commit ba982e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cpp/ql/lib/semmle/code/cpp/security/BufferAccess.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,8 @@ class FreadBA extends BufferAccess {
314314
* but not:
315315
* &buffer[ix]
316316
*/
317-
class ArrayExprBA extends BufferAccess {
317+
class ArrayExprBA extends BufferAccess, ArrayExpr {
318318
ArrayExprBA() {
319-
exists(this.(ArrayExpr).getArrayOffset().getValue().toInt()) and
320319
not exists(AddressOfExpr aoe | aoe.getAChild() = this) and
321320
// exclude accesses in macro implementation of `strcmp`,
322321
// which are carefully controlled but can look dangerous.

0 commit comments

Comments
 (0)