Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 173b16a

Browse files
authored
Merge pull request #5169 from criemen/bsl-pure
C++: Model bsl functions in Pure.qll.
2 parents 80eaf0b + 5dc57e9 commit 173b16a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • cpp/ql/src/semmle/code/cpp/models/implementations

cpp/ql/src/semmle/code/cpp/models/implementations/Pure.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import semmle.code.cpp.models.interfaces.SideEffect
77
private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunction,
88
SideEffectFunction {
99
PureStrFunction() {
10-
hasGlobalOrStdName([
10+
hasGlobalOrStdOrBslName([
1111
atoi(), "strcasestr", "strchnul", "strchr", "strchrnul", "strstr", "strpbrk", "strrchr",
1212
"strspn", strtol(), strrev(), strcmp(), strlwr(), strupr()
1313
])
@@ -92,7 +92,7 @@ private string strcmp() {
9292
/** String standard `strlen` function, and related functions for computing string lengths. */
9393
private class StrLenFunction extends AliasFunction, ArrayFunction, SideEffectFunction {
9494
StrLenFunction() {
95-
hasGlobalOrStdName(["strlen", "strnlen", "wcslen"])
95+
hasGlobalOrStdOrBslName(["strlen", "strnlen", "wcslen"])
9696
or
9797
hasGlobalName(["_mbslen", "_mbslen_l", "_mbstrlen", "_mbstrlen_l"])
9898
}
@@ -125,7 +125,7 @@ private class StrLenFunction extends AliasFunction, ArrayFunction, SideEffectFun
125125

126126
/** Pure functions. */
127127
private class PureFunction extends TaintFunction, SideEffectFunction {
128-
PureFunction() { hasGlobalOrStdName(["abs", "labs"]) }
128+
PureFunction() { hasGlobalOrStdOrBslName(["abs", "labs"]) }
129129

130130
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
131131
exists(ParameterIndex i |
@@ -144,7 +144,7 @@ private class PureFunction extends TaintFunction, SideEffectFunction {
144144
private class PureMemFunction extends AliasFunction, ArrayFunction, TaintFunction,
145145
SideEffectFunction {
146146
PureMemFunction() {
147-
hasGlobalOrStdName([
147+
hasGlobalOrStdOrBslName([
148148
"memchr", "__builtin_memchr", "memrchr", "rawmemchr", "memcmp", "__builtin_memcmp", "memmem"
149149
]) or
150150
this.hasGlobalName("memfrob")

0 commit comments

Comments
 (0)