C++: Replace hasQualifiedName by hasGlobalName in docs examples

This commit is contained in:
Jeroen Ketema
2023-03-03 15:08:00 +01:00
parent f6ce27075c
commit fe5fbaa142
7 changed files with 20 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ import cpp
import semmle.code.cpp.dataflow.new.DataFlow
class GetenvSource extends DataFlow::Node {
GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasQualifiedName("getenv") }
GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasGlobalName("getenv") }
}
class GetenvToGethostbynameConfiguration extends DataFlow::Configuration {

View File

@@ -3,7 +3,7 @@ import semmle.code.cpp.dataflow.new.DataFlow
from Function fopen, FunctionCall fc, Expr src, DataFlow::Node source, DataFlow::Node sink
where
fopen.hasQualifiedName("fopen") and
fopen.hasGlobalName("fopen") and
fc.getTarget() = fopen and
source.asIndirectExpr(1) = src and
sink.asIndirectExpr(1) = fc.getArgument(0) and

View File

@@ -7,14 +7,14 @@ class EnvironmentToFileConfiguration extends DataFlow::Configuration {
override predicate isSource(DataFlow::Node source) {
exists(Function getenv |
source.asIndirectExpr(1).(FunctionCall).getTarget() = getenv and
getenv.hasQualifiedName("getenv")
getenv.hasGlobalName("getenv")
)
}
override predicate isSink(DataFlow::Node sink) {
exists(FunctionCall fc |
sink.asIndirectExpr(1) = fc.getArgument(0) and
fc.getTarget().hasQualifiedName("fopen")
fc.getTarget().hasGlobalName("fopen")
)
}
}

View File

@@ -3,7 +3,7 @@ import semmle.code.cpp.dataflow.new.DataFlow
from Function fopen, FunctionCall fc, Parameter p, DataFlow::Node source, DataFlow::Node sink
where
fopen.hasQualifiedName("fopen") and
fopen.hasGlobalName("fopen") and
fc.getTarget() = fopen and
source.asParameter(1) = p and
sink.asIndirectExpr(1) = fc.getArgument(0) and

View File

@@ -2,6 +2,6 @@ import cpp
from Function fopen, FunctionCall fc
where
fopen.hasQualifiedName("fopen") and
fopen.hasGlobalName("fopen") and
fc.getTarget() = fopen
select fc.getArgument(0)