1 Star 0 Fork 45

小松鼠/tensorflow

forked from src-openEuler/tensorflow 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-29575.patch 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
From ecf768cbe50cedc0a45ce1ee223146a3d3d26d23 Mon Sep 17 00:00:00 2001
From: Mihai Maruseac <mihaimaruseac@google.com>
Date: Wed, 5 May 2021 12:07:57 -0700
Subject: [PATCH] Add missing validations to reverse_sequence_op
PiperOrigin-RevId: 372178683
Change-Id: Iac97ebab5b342f1262c77a7d9bcb4267b305ce5b
---
tensorflow/core/kernels/reverse_sequence_op.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tensorflow/core/kernels/reverse_sequence_op.cc b/tensorflow/core/kernels/reverse_sequence_op.cc
index b5b62bc76ca52..1282deb26e8cd 100644
--- a/tensorflow/core/kernels/reverse_sequence_op.cc
+++ b/tensorflow/core/kernels/reverse_sequence_op.cc
@@ -115,6 +115,10 @@ class ReverseSequenceOp : public OpKernel {
: OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("batch_dim", &batch_dim_));
OP_REQUIRES_OK(context, context->GetAttr("seq_dim", &seq_dim_));
+ OP_REQUIRES(context, batch_dim_ >= 0,
+ errors::InvalidArgument("Invalid batch_dim ", batch_dim_));
+ OP_REQUIRES(context, seq_dim_ >= 0,
+ errors::InvalidArgument("Invalid seq_dim ", seq_dim_));
}
void Compute(OpKernelContext* context) override {
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wang_songsong/tensorflow.git
git@gitee.com:wang_songsong/tensorflow.git
wang_songsong
tensorflow
tensorflow
master

搜索帮助