mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
C++: Add a new model class describing pure memory functions, and use this new model in DefaultSafeExternalAPIFunction.
This commit is contained in:
@@ -12,5 +12,9 @@ abstract class SafeExternalAPIFunction extends Function { }
|
||||
|
||||
/** The default set of "safe" external APIs. */
|
||||
private class DefaultSafeExternalAPIFunction extends SafeExternalAPIFunction {
|
||||
DefaultSafeExternalAPIFunction() { this.hasGlobalName(["strcmp", "strlen", "memcmp"]) }
|
||||
DefaultSafeExternalAPIFunction() {
|
||||
this instanceof PureStrFunction or
|
||||
this instanceof StrLenFunction or
|
||||
this instanceof PureMemFunction
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,9 @@ abstract class SafeExternalAPIFunction extends Function { }
|
||||
|
||||
/** The default set of "safe" external APIs. */
|
||||
private class DefaultSafeExternalAPIFunction extends SafeExternalAPIFunction {
|
||||
DefaultSafeExternalAPIFunction() { this.hasGlobalName(["strcmp", "strlen", "memcmp"]) }
|
||||
DefaultSafeExternalAPIFunction() {
|
||||
this instanceof PureStrFunction or
|
||||
this instanceof StrLenFunction or
|
||||
this instanceof PureMemFunction
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user