Skip to content

Commit 2c7e2c4

Browse files
committed
CPP: Not in std namespace.
1 parent f16870f commit 2c7e2c4

File tree

1 file changed

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

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ import semmle.code.cpp.models.interfaces.Taint
99
class StrdupFunction extends AllocationFunction, ArrayFunction, DataFlowFunction {
1010
StrdupFunction() {
1111
exists(string name |
12-
hasGlobalOrStdName(name) and
12+
hasGlobalName(name) and
1313
(
1414
// strdup(str)
1515
name = "strdup"
1616
or
1717
// wcsdup(str)
1818
name = "wcsdup"
19-
)
20-
or
21-
hasGlobalName(name) and
22-
(
19+
or
2320
// _strdup(str)
2421
name = "_strdup"
2522
or
@@ -50,7 +47,7 @@ class StrdupFunction extends AllocationFunction, ArrayFunction, DataFlowFunction
5047
class StrndupFunction extends AllocationFunction, ArrayFunction, TaintFunction {
5148
StrndupFunction() {
5249
exists(string name |
53-
hasGlobalOrStdName(name) and
50+
hasGlobalName(name) and
5451
// strndup(str, maxlen)
5552
name = "strndup"
5653
)

0 commit comments

Comments
 (0)