114 Star 0 Fork 14

src-openEuler/nasm
关闭

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2023-38665.patch 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
liningjie 提交于 2024-10-26 16:06 +08:00 . Fix CVE-2023-38665
From c8af73112027fad0ecbb277e9cba257678c405af Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Wed, 7 Dec 2022 10:23:46 -0800
Subject: [PATCH] outieee: fix segfault on empty input
Fix the IEEE backend crashing if the input file is empty.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
output/outieee.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/output/outieee.c b/output/outieee.c
index 878a17a4..7ba90366 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 1996-2016 The NASM Authors - All Rights Reserved
+ * Copyright 1996-2022 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@@ -936,7 +936,7 @@ static void ieee_write_file(void)
* Write the section headers
*/
seg = seghead;
- if (!debuginfo && !strcmp(seg->name, "??LINE"))
+ if (!debuginfo && seg && !strcmp(seg->name, "??LINE"))
seg = seg->next;
while (seg) {
char buf[256];
@@ -971,7 +971,7 @@ static void ieee_write_file(void)
/*
* write the start address if there is one
*/
- if (ieee_entry_seg) {
+ if (ieee_entry_seg && seghead) {
for (seg = seghead; seg; seg = seg->next)
if (seg->index == ieee_entry_seg)
break;
@@ -1084,7 +1084,7 @@ static void ieee_write_file(void)
* put out section data;
*/
seg = seghead;
- if (!debuginfo && !strcmp(seg->name, "??LINE"))
+ if (!debuginfo && seg && !strcmp(seg->name, "??LINE"))
seg = seg->next;
while (seg) {
if (seg->currentpos) {
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/nasm.git
git@gitee.com:src-openeuler/nasm.git
src-openeuler
nasm
nasm
openEuler-22.03-LTS-SP4

搜索帮助