开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
main
分支 (1683)
标签 (158)
main
criemen/per-lang-cargo
codeql-cli-2.24.0
ginsbach/OverlayDocumentation
copilot/sub-pr-21184
andersfugmann/kotlin_2.3.0-beta2
copilot/implement-goal-stretch-goal
tausbn/python-prepare-for-overlay-annotations
jketema/go-1.26
tausbn/python-add-dataflow-overlay-annotations
mbg/java/maven-plugin-repo-changenote
java/allow-mad-barriers
copilot/refactor-regex-use-sink-kind
redsun82/rust-compress-trap
igfoo/add-workflow-dispatch-to-compile-queries
rc/3.20
codeql-cli-2.23.9
lgtm.com
dependabot/go_modules/go/ql/test/experimental/CWE-321-V2/go_modules-2f167fc27b
dependabot/maven/java/ql/test/utils/flowtestcasegenerator/maven-3ca36f8ef4
codeql-cli/latest
codeql-cli/v2.23.9
codeql-cli/v2.23.8
codeql-cli/v2.23.7
codeql-cli/v2.23.6
codeql-cli/v2.23.5
codeql-cli/v2.23.3
codeql-cli/v2.23.2
codeql-cli/v2.23.1
codeql-cli/v2.23.0
codeql-cli/v2.22.4
codeql-cli/v2.22.3
codeql-cli/v2.22.2
codeql-cli/v2.22.1
codeql-cli/v2.22.0
codeql-cli/v2.21.4
codeql-cli/v2.21.3
codeql-cli/v2.21.2
codeql-cli/v2.21.1
codeql-cli/v2.21.0
main
分支 (1683)
标签 (158)
main
criemen/per-lang-cargo
codeql-cli-2.24.0
ginsbach/OverlayDocumentation
copilot/sub-pr-21184
andersfugmann/kotlin_2.3.0-beta2
copilot/implement-goal-stretch-goal
tausbn/python-prepare-for-overlay-annotations
jketema/go-1.26
tausbn/python-add-dataflow-overlay-annotations
mbg/java/maven-plugin-repo-changenote
java/allow-mad-barriers
copilot/refactor-regex-use-sink-kind
redsun82/rust-compress-trap
igfoo/add-workflow-dispatch-to-compile-queries
rc/3.20
codeql-cli-2.23.9
lgtm.com
dependabot/go_modules/go/ql/test/experimental/CWE-321-V2/go_modules-2f167fc27b
dependabot/maven/java/ql/test/utils/flowtestcasegenerator/maven-3ca36f8ef4
codeql-cli/latest
codeql-cli/v2.23.9
codeql-cli/v2.23.8
codeql-cli/v2.23.7
codeql-cli/v2.23.6
codeql-cli/v2.23.5
codeql-cli/v2.23.3
codeql-cli/v2.23.2
codeql-cli/v2.23.1
codeql-cli/v2.23.0
codeql-cli/v2.22.4
codeql-cli/v2.22.3
codeql-cli/v2.22.2
codeql-cli/v2.22.1
codeql-cli/v2.22.0
codeql-cli/v2.21.4
codeql-cli/v2.21.3
codeql-cli/v2.21.2
codeql-cli/v2.21.1
codeql-cli/v2.21.0
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
main
分支 (1683)
标签 (158)
main
criemen/per-lang-cargo
codeql-cli-2.24.0
ginsbach/OverlayDocumentation
copilot/sub-pr-21184
andersfugmann/kotlin_2.3.0-beta2
copilot/implement-goal-stretch-goal
tausbn/python-prepare-for-overlay-annotations
jketema/go-1.26
tausbn/python-add-dataflow-overlay-annotations
mbg/java/maven-plugin-repo-changenote
java/allow-mad-barriers
copilot/refactor-regex-use-sink-kind
redsun82/rust-compress-trap
igfoo/add-workflow-dispatch-to-compile-queries
rc/3.20
codeql-cli-2.23.9
lgtm.com
dependabot/go_modules/go/ql/test/experimental/CWE-321-V2/go_modules-2f167fc27b
dependabot/maven/java/ql/test/utils/flowtestcasegenerator/maven-3ca36f8ef4
codeql-cli/latest
codeql-cli/v2.23.9
codeql-cli/v2.23.8
codeql-cli/v2.23.7
codeql-cli/v2.23.6
codeql-cli/v2.23.5
codeql-cli/v2.23.3
codeql-cli/v2.23.2
codeql-cli/v2.23.1
codeql-cli/v2.23.0
codeql-cli/v2.22.4
codeql-cli/v2.22.3
codeql-cli/v2.22.2
codeql-cli/v2.22.1
codeql-cli/v2.22.0
codeql-cli/v2.21.4
codeql-cli/v2.21.3
codeql-cli/v2.21.2
codeql-cli/v2.21.1
codeql-cli/v2.21.0
codeql
/
python
/
ql
/
src
/
Variables
/
Undefined.qll
codeql
/
python
/
ql
/
src
/
Variables
/
Undefined.qll
Undefined.qll 3.41 KB
一键复制 编辑 原始数据 按行查看 历史
Taus 提交于 2025年10月31日 07:06 +08:00 . Python: Fix query tests
import python
import Loop
import semmle.python.dataflow.TaintTracking
private import LegacyPointsTo
/** A marker for "uninitialized". */
class Uninitialized extends TaintKind {
Uninitialized() { this = "undefined" }
}
private predicate loop_entry_variables(EssaVariable pred, EssaVariable succ) {
exists(PhiFunction phi, BasicBlock pb |
loop_entry_edge(pb, phi.getBasicBlock()) and
succ = phi.getVariable() and
pred = phi.getInput(pb)
)
}
private predicate loop_entry_edge(BasicBlock pred, BasicBlock loop) {
pred = loop.getAPredecessor() and
pred = loop.getImmediateDominator() and
exists(Stmt s |
loop_probably_executes_at_least_once(s) and
s.getAFlowNode().getBasicBlock() = loop
)
}
/**
* Since any use of a local will raise if it is uninitialized, then
* any use dominated by another use of the same variable must be defined, or is unreachable.
*/
private predicate first_use(NameNode u, EssaVariable v) {
v.getASourceUse() = u and
not exists(NameNode other |
v.getASourceUse() = other and
other.strictlyDominates(u)
)
}
/**
* Holds if `call` is a call of the form obj.method_name(...) and
* there is a function called `method_name` that can exit the program.
*/
private predicate maybe_call_to_exiting_function(CallNode call) {
exists(FunctionValue exits, string name | exits.neverReturns() and exits.getName() = name |
call.getFunction().(NameNode).getId() = name or
call.getFunction().(AttrNode).getName() = name
)
}
predicate exitFunctionGuardedEdge(EssaVariable pred, EssaVariable succ) {
exists(CallNode exit_call |
succ.(PhiFunction).getInput(exit_call.getBasicBlock()) = pred and
maybe_call_to_exiting_function(exit_call)
)
}
class UninitializedConfig extends TaintTracking::Configuration {
UninitializedConfig() { this = "Uninitialized local config" }
override predicate isSource(DataFlow::Node source, TaintKind kind) {
kind instanceof Uninitialized and
exists(EssaVariable var |
source.asVariable() = var and
var.getSourceVariable() instanceof FastLocalVariable and
not var.getSourceVariable().(Variable).escapes()
|
var instanceof ScopeEntryDefinition
or
var instanceof DeletionDefinition
)
}
override predicate isBarrier(DataFlow::Node node, TaintKind kind) {
kind instanceof Uninitialized and
(
this.definition(node.asVariable())
or
this.use(node.asVariable())
or
this.sanitizingNode(node.asCfgNode())
)
}
private predicate definition(EssaDefinition def) {
def instanceof AssignmentDefinition
or
def instanceof ExceptionCapture
or
def instanceof ParameterDefinition
}
private predicate use(EssaDefinition def) {
exists(def.(EssaNodeRefinement).getInput().getASourceUse())
or
exists(def.(PhiFunction).getAnInput().getASourceUse())
or
exists(def.(EssaEdgeRefinement).getInput().getASourceUse())
}
private predicate sanitizingNode(ControlFlowNode node) {
exists(EssaVariable v |
v.getASourceUse() = node and
not first_use(node, v)
)
}
override predicate isBarrierEdge(DataFlow::Node src, DataFlow::Node dest) {
/*
* If we are guaranteed to iterate over a loop at least once, then we can prune any edges that
* don't pass through the body.
*/
loop_entry_variables(src.asVariable(), dest.asVariable())
or
exitFunctionGuardedEdge(src.asVariable(), dest.asVariable())
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/any3ite/codeql.git
git@gitee.com:any3ite/codeql.git
any3ite
codeql
codeql
main
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /