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

Skip to content

Commit fddd353

Browse files
committed
C++: Updated autoformat.
1 parent 4b8f338 commit fddd353

3 files changed

Lines changed: 25 additions & 17 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,10 @@ private class IteratorAssignmentMemberOperator extends MemberFunction, TaintFunc
308308
private class BeginOrEndFunction extends MemberFunction, TaintFunction, GetIteratorFunction {
309309
BeginOrEndFunction() {
310310
this
311-
.hasName(["begin", "cbegin", "rbegin", "crbegin", "end", "cend", "rend", "crend",
312-
"before_begin", "cbefore_begin"]) and
311+
.hasName([
312+
"begin", "cbegin", "rbegin", "crbegin", "end", "cend", "rend", "crend", "before_begin",
313+
"cbefore_begin"
314+
]) and
313315
this.getType().getUnspecifiedType() instanceof Iterator
314316
}
315317

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import semmle.code.cpp.models.interfaces.SideEffect
66
private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunction,
77
SideEffectFunction {
88
PureStrFunction() {
9-
hasGlobalOrStdName(["atof", "atoi", "atol", "atoll", "strcasestr", "strchnul", "strchr",
10-
"strchrnul", "strstr", "strpbrk", "strcmp", "strcspn", "strncmp", "strrchr", "strspn",
11-
"strtod", "strtof", "strtol", "strtoll", "strtoq", "strtoul"])
9+
hasGlobalOrStdName([
10+
"atof", "atoi", "atol", "atoll", "strcasestr", "strchnul", "strchr", "strchrnul", "strstr",
11+
"strpbrk", "strcmp", "strcspn", "strncmp", "strrchr", "strspn", "strtod", "strtof",
12+
"strtol", "strtoll", "strtoq", "strtoul"
13+
])
1214
}
1315

1416
override predicate hasArrayInput(int bufParam) {

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ import semmle.code.cpp.models.interfaces.SideEffect
1414
class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, SideEffectFunction {
1515
StrcpyFunction() {
1616
getName() =
17-
["strcpy", // strcpy(dst, src)
18-
"wcscpy", // wcscpy(dst, src)
19-
"_mbscpy", // _mbscpy(dst, src)
20-
"strncpy", // strncpy(dst, src, max_amount)
21-
"_strncpy_l", // _strncpy_l(dst, src, max_amount, locale)
22-
"wcsncpy", // wcsncpy(dst, src, max_amount)
23-
"_wcsncpy_l", // _wcsncpy_l(dst, src, max_amount, locale)
24-
"_mbsncpy", // _mbsncpy(dst, src, max_amount)
25-
"_mbsncpy_l"] // _mbsncpy_l(dst, src, max_amount, locale)
17+
[
18+
"strcpy", // strcpy(dst, src)
19+
"wcscpy", // wcscpy(dst, src)
20+
"_mbscpy", // _mbscpy(dst, src)
21+
"strncpy", // strncpy(dst, src, max_amount)
22+
"_strncpy_l", // _strncpy_l(dst, src, max_amount, locale)
23+
"wcsncpy", // wcsncpy(dst, src, max_amount)
24+
"_wcsncpy_l", // _wcsncpy_l(dst, src, max_amount, locale)
25+
"_mbsncpy", // _mbsncpy(dst, src, max_amount)
26+
"_mbsncpy_l"
27+
] // _mbsncpy_l(dst, src, max_amount, locale)
2628
or
2729
getName() =
28-
["strcpy_s", // strcpy_s(dst, max_amount, src)
29-
"wcscpy_s", // wcscpy_s(dst, max_amount, src)
30-
"_mbscpy_s"] and // _mbscpy_s(dst, max_amount, src)
30+
[
31+
"strcpy_s", // strcpy_s(dst, max_amount, src)
32+
"wcscpy_s", // wcscpy_s(dst, max_amount, src)
33+
"_mbscpy_s"
34+
] and // _mbscpy_s(dst, max_amount, src)
3135
// exclude the 2-parameter template versions
3236
// that find the size of a fixed size destination buffer.
3337
getNumberOfParameters() = 3

0 commit comments

Comments
 (0)