20 Star 0 Fork 24

openEuler-RISC-V/busybox

forked from src-openEuler/busybox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-use-after-free-in-bc-module.patch 898 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 907e1b3a22a8092461176af45468c5b1b9bf6cc0 Mon Sep 17 00:00:00 2001
From: jackey_1024 <[email protected]>
Date: Fri, 28 Oct 2022 09:45:08 +0800
Subject: [PATCH] busybox: fix use after free in bc module
backport from upstream:
https://git.busybox.net/busybox/commit/?id=41d5f800a14769704082f7faeabb8435285499be
Signed-off-by: jackey_1024 <[email protected]>
---
miscutils/bc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/miscutils/bc.c b/miscutils/bc.c
index f9b08b0..4363585 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -2892,6 +2892,8 @@ static char peek_inbuf(void)
) {
xc_read_line(&G.input_buffer, G.prs.lex_input_fp);
G.prs.lex_inbuf = G.input_buffer.v;
+ // lex_next_at may point to now-freed data, update it:
+ G.prs.lex_next_at = G.prs.lex_inbuf;
if (G.input_buffer.len <= 1) // on EOF, len is 1 (NUL byte)
G.prs.lex_input_fp = NULL;
}
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-risc-v/busybox.git
[email protected]:openeuler-risc-v/busybox.git
openeuler-risc-v
busybox
busybox
master

搜索帮助