1 Star 0 Fork 10

Ami-zhang/llvm_oc

forked from OpenCloudOS Stream/llvm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2023-46049.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
rockerzhu 提交于 2024-04-01 16:36 . Fix CVE-2023-46049
From c2515a8f2be5dd23354c9891f41ad104000f88c4 Mon Sep 17 00:00:00 2001
From: Nikita Popov <[email protected]>
Date: Tue, 26 Sep 2023 16:51:40 +0200
Subject: [PATCH] [Bitcode] Add some missing GetTypeByID failure checks
Print an error instead of crashing.
Fixes https://github.com/llvm/llvm-project/issues/67388.
---
llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index b4b8690523244e..2b52b46a4ee5c4 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1315,7 +1315,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
unsigned TyID = Record[0];
Type *Ty = Callbacks.GetTypeByID(TyID);
- if (Ty->isMetadataTy() || Ty->isVoidTy()) {
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy()) {
dropRecord();
break;
}
@@ -1366,7 +1366,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
unsigned TyID = Record[0];
Type *Ty = Callbacks.GetTypeByID(TyID);
- if (Ty->isMetadataTy() || Ty->isVoidTy())
+ if (!Ty || Ty->isMetadataTy() || Ty->isVoidTy())
return error("Invalid record");
Value *V = ValueList.getValueFwdRef(Record[1], Ty, TyID,
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ami-zhang/llvm_oc.git
[email protected]:ami-zhang/llvm_oc.git
ami-zhang
llvm_oc
llvm_oc
master

搜索帮助