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

Skip to content

Commit 5dc57e9

Browse files
authored
C++: Address review.
1 parent c9af97b commit 5dc57e9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cpp/ql/src/semmle/code/cpp/Declaration.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ class Declaration extends Locatable, @declaration {
142142
/**
143143
* Holds if this declaration has the given name in the global namespace,
144144
* the `std` namespace or the `bsl` namespace.
145-
* We treat `std` and `bsl` as the same in a bunch of our models.
145+
* We treat `std` and `bsl` as the same in some of our models.
146146
*/
147-
predicate hasGlobalOrStdishName(string name) {
147+
predicate hasGlobalOrStdOrBslName(string name) {
148148
this.hasGlobalName(name)
149149
or
150150
this.hasQualifiedName("std", "", name)

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-
hasGlobalOrStdishName([
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-
hasGlobalOrStdishName(["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() { hasGlobalOrStdishName(["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-
hasGlobalOrStdishName([
147+
hasGlobalOrStdOrBslName([
148148
"memchr", "__builtin_memchr", "memrchr", "rawmemchr", "memcmp", "__builtin_memcmp", "memmem"
149149
]) or
150150
this.hasGlobalName("memfrob")

0 commit comments

Comments
 (0)