1 Star 0 Fork 8

李宁杰/sox

forked from src-openEuler/sox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-3643.patch 871 Bytes
一键复制 编辑 原始数据 按行查看 历史
From: Helmut Grohne <[email protected]>
Date: Sat, 11 Nov 2023 18:18:40 +0100
Subject: voc: word width should never be 0 to avoid division by zero
Bug: https://sourceforge.net/p/sox/bugs/351/
Bug-Debian: https://bugs.debian.org/1010374
This patch fixes both CVE-2021-3643 and CVE-2021-23210.
---
src/voc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/voc.c b/src/voc.c
index f026178..f44933d 100644
--- a/src/voc.c
+++ b/src/voc.c
@@ -614,6 +614,10 @@ static int getblock(sox_format_t * ft)
v->rate = new_rate_32;
ft->signal.rate = new_rate_32;
lsx_readb(ft, &uc);
+ if (uc <= 1) {
+ lsx_fail_errno(ft, SOX_EFMT, "2 bits per word required");
+ return (SOX_EOF);
+ }
v->size = uc;
lsx_readb(ft, &(v->channels));
lsx_readw(ft, &(v->format)); /* ANN: added format */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li_ning_jie/sox.git
[email protected]:li_ning_jie/sox.git
li_ning_jie
sox
sox
master

搜索帮助