C++: Exclude integral types from SensitiveExprs.

This commit is contained in:
Geoffrey White
2021-07-15 14:44:14 +01:00
parent dd95c53a3e
commit e5e8a1b781
3 changed files with 11 additions and 8 deletions

View File

@@ -27,14 +27,20 @@ private predicate suspicious(string s) {
* A variable that might contain a password or other sensitive information.
*/
class SensitiveVariable extends Variable {
SensitiveVariable() { suspicious(getName().toLowerCase()) }
SensitiveVariable() {
suspicious(getName().toLowerCase()) and
not this.getUnspecifiedType() instanceof IntegralType
}
}
/**
* A function that might return a password or other sensitive information.
*/
class SensitiveFunction extends Function {
SensitiveFunction() { suspicious(getName().toLowerCase()) }
SensitiveFunction() {
suspicious(getName().toLowerCase()) and
not this.getUnspecifiedType() instanceof IntegralType
}
}
/**