mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Merge pull request #12752 from gsingh93/buffer-access-array-expr
C++: Consider ArrayExpr with non-constant size expressions as a BufferAccess
This commit is contained in:
@@ -314,9 +314,8 @@ class FreadBA extends BufferAccess {
|
||||
* but not:
|
||||
* &buffer[ix]
|
||||
*/
|
||||
class ArrayExprBA extends BufferAccess {
|
||||
class ArrayExprBA extends BufferAccess, ArrayExpr {
|
||||
ArrayExprBA() {
|
||||
exists(this.(ArrayExpr).getArrayOffset().getValue().toInt()) and
|
||||
not exists(AddressOfExpr aoe | aoe.getAChild() = this) and
|
||||
// exclude accesses in macro implementation of `strcmp`,
|
||||
// which are carefully controlled but can look dangerous.
|
||||
|
||||
Reference in New Issue
Block a user