1 Star 0 Fork 3

rockerzhu/libarchive

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2024-48958.patch 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
rockerzhu 提交于 2024-10-11 11:34 . fix CVE-2024-48957 and CVE-2024-48958
From 17d9d73ee92eeb1a08b0a56659d010d8120af33a Mon Sep 17 00:00:00 2001
From: Wei-Cheng Pan <legnaleurc@gmail.com>
Date: Fri, 26 Apr 2024 13:58:34 +0900
Subject: [PATCH] fix: OOB in rar delta filter
---
libarchive/archive_read_support_format_rar.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
index 79669a8f4..619ee81e2 100644
--- a/libarchive/archive_read_support_format_rar.c
+++ b/libarchive/archive_read_support_format_rar.c
@@ -3612,7 +3612,15 @@ execute_filter_delta(struct rar_filter *filter, struct rar_virtual_machine *vm)
{
uint8_t lastbyte = 0;
for (idx = i; idx < length; idx += numchannels)
+ {
+ /*
+ * The src block should not overlap with the dst block.
+ * If so it would be better to consider this archive is broken.
+ */
+ if (src >= dst)
+ return 0;
lastbyte = dst[idx] = lastbyte - *src++;
+ }
}
filter->filteredblockaddress = length;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rockerzhu/libarchive.git
git@gitee.com:rockerzhu/libarchive.git
rockerzhu
libarchive
libarchive
master

搜索帮助