Skip to content

Commit 735e014

Browse files
committed
C++: Model BSL in Gets.qll.
1 parent 92df1f7 commit 735e014

File tree

1 file changed

+3
-3
lines changed
  • cpp/ql/src/semmle/code/cpp/models/implementations

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private class GetsFunction extends DataFlowFunction, TaintFunction, ArrayFunctio
1919
// gets(str)
2020
// fgets(str, num, stream)
2121
// fgetws(wstr, num, stream)
22-
hasGlobalOrStdName(["gets", "fgets", "fgetws"])
22+
hasGlobalOrStdOrBslName(["gets", "fgets", "fgetws"])
2323
}
2424

2525
override predicate hasDataFlow(FunctionInput input, FunctionOutput output) {
@@ -54,13 +54,13 @@ private class GetsFunction extends DataFlowFunction, TaintFunction, ArrayFunctio
5454
}
5555

5656
override predicate hasArrayWithVariableSize(int bufParam, int countParam) {
57-
not hasGlobalOrStdName("gets") and
57+
not hasName("gets") and
5858
bufParam = 0 and
5959
countParam = 1
6060
}
6161

6262
override predicate hasArrayWithUnknownSize(int bufParam) {
63-
hasGlobalOrStdName("gets") and
63+
hasName("gets") and
6464
bufParam = 0
6565
}
6666

0 commit comments

Comments
 (0)