Merge pull request #1781 from kevinbackhouse/filter_xmpsdk

Ignore results in the xmpsdk directory
This commit is contained in:
Kevin Backhouse 2021-07-16 12:28:17 +01:00 committed by GitHub
commit 8f126c0664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,5 +175,7 @@ where
not index_last_with_check(_, call) and
// Ignore accesses like this: `vsnprintf(&buffer[0], buffer.size(), format, args)`
// That's pointer arithmetic, not a deref, so it's usually a false positive.
not exists(AddressOfExpr addrExpr | addrExpr.getOperand() = call)
not exists(AddressOfExpr addrExpr | addrExpr.getOperand() = call) and
// Ignore results in the xmpsdk directory.
not call.getLocation().getFile().getRelativePath().matches("xmpsdk/%")
select call, "Unsafe use of operator[]. Use the at() method instead."