1 Star 0 Fork 20

src-oepkgs-oE-rv/exiv2

forked from src-openEuler/exiv2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2018-9145.patch 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
zhanzhimin 提交于 2020-09-17 16:53 . add CVE-2018-9145.patch
From c03f73268f65c73f9d3d7b670f13e48e92692750 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roberto=20C=2E=20S=C3=A1nchez?= <roberto@connexer.com>
Date: Fri, 18 Sep 2020 14:40:36 +0800
Subject: [PATCH] Prevent SIGABRT on excessive subBox length in jp2image.cpp
This fixes CVE-2018-9145
---
src/jp2image.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index 3cebc2a..6a662fa 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -505,6 +505,10 @@ namespace Exiv2
subBox.length = getLong((byte*)&subBox.length, bigEndian);
subBox.type = getLong((byte*)&subBox.type, bigEndian);
+ // subBox.length makes no sense if it is larger than the rest of the file
+ if (subBox.length > io_->size() - io_->tell()) {
+ throw Error(kerCorruptedMetadata);
+ }
DataBuf data(subBox.length-sizeof(box));
io_->read(data.pData_,data.size_);
if ( bPrint ) {
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs-oe-rv/exiv2.git
git@gitee.com:src-oepkgs-oe-rv/exiv2.git
src-oepkgs-oe-rv
exiv2
exiv2
master

搜索帮助