mirror of
https://github.com/github/codeql.git
synced 2026-02-05 17:51:06 +01:00
C++: Replace hasQualifiedName by hasGlobalName in docs examples
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user