20 Star 0 Fork 26

openEuler-RISC-V/busybox

forked from src-openEuler/busybox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-CVE-2022-30065.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
jackey_1024 提交于 2022-08-19 16:58 +08:00 . busybox: fix CVE-2022-30065
From 111ae0c7f21dc600a2d2afcbecc69d73036a163f Mon Sep 17 00:00:00 2001
From: jackey_1024 <jikui2@huawei.com>
Date: Fri, 19 Aug 2022 16:15:59 +0800
Subject: [PATCH] busybox: fix CVE-2022-30065
backport from upstream:
https://git.busybox.net/busybox/commit/?id=e63d7cdfdac78c6fd27e9e63150335767592b85e
Signed-off-by: jackey_1024 <jikui2@huawei.com>
---
editors/awk.c | 3 +++
testsuite/awk.tests | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/editors/awk.c b/editors/awk.c
index f6314ac..6a5846e 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -3114,6 +3114,9 @@ static var *evaluate(node *op, var *res)
case XC( OC_MOVE ):
debug_printf_eval("MOVE\n");
+ /* make sure that we never return a temp var */
+ if (L.v == TMPVAR0)
+ L.v = res;
/* if source is a temporary string, jusk relink it to dest */
if (R.v == TMPVAR1
&& !(R.v->type & VF_NUMBER)
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index bcaafe8..156aa65 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -469,4 +469,10 @@ testing 'awk printf %% prints one %' \
"%\n" \
'' ''
+testing 'awk assign while test' \
+ "awk '\$1==\$1=\"foo\" {print \$1}'" \
+ "foo\n" \
+ "" \
+ "foo"
+
exit $FAILCOUNT
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-risc-v/busybox.git
git@gitee.com:openeuler-risc-v/busybox.git
openeuler-risc-v
busybox
busybox
master

搜索帮助