加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport_CVE-2024-31744.patch 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
cenhuilin 提交于 2024-04-28 11:03 . fix CVE-2024-31744
From 6d084c53a77762f41bb5310713a5f1872fef55f5 Mon Sep 17 00:00:00 2001
From: Michael Adams <mdadams@ece.uvic.ca>
Date: Sun, 28 Apr 2024 10:43:08 +0800
Subject: [PATCH] Fixes #381.
Added a missing check to the jpc_dec_process_sod function of the JPC codec.
Added another image to the test set.
---
data/test/bad/318.jpc | Bin 0 -> 320 bytes
src/libjasper/jpc/jpc_dec.c | 4 +++-
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 data/test/bad/318.jpc
diff --git a/data/test/bad/318.jpc b/data/test/bad/318.jpc
new file mode 100644
index 0000000000000000000000000000000000000000..8446ccb36b5a6ab04b1d7621ff2f9ae9980cd047
GIT binary patch
literal 320
zcmezG|38pHp8*88fLIdDf)F4+2txoPJ0leRPhj8yiLw6w_lAM-e+&b!gM)`h00jL{
zXHbRe08yxBFeA(e0-M3ez|6veX+{dr3`Xao)Wnk16osTpg*X41fXW!aR`GdwxI?Xq
z11d`bD=P#m^Djt!=M|9Ru27a*RGgWgr(mRKqG#}b0@N33K#L~dhdB<YIL|A<6{@%g
ySuqm>1LGZ#;^SAiPO>wqbm$)~zU%$&Nbbcrw#w=D+^b5y{E|Ib&pabRX%_&AicE?C
literal 0
HcmV?d00001
diff --git a/src/libjasper/jpc/jpc_dec.c b/src/libjasper/jpc/jpc_dec.c
index e76aa40..125a29b 100644
--- a/src/libjasper/jpc/jpc_dec.c
+++ b/src/libjasper/jpc/jpc_dec.c
@@ -611,7 +611,9 @@ static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms)
if (dec->pkthdrstreams) {
/* Get the stream containing the packet header data for this
tile-part. */
- if (!(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams, 0))) {
+ if (jpc_streamlist_numstreams(dec->pkthdrstreams) != 0 &&
+ !(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams,
+ 0))) {
return -1;
}
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化