fix CVE-2023-37732
(cherry picked from commit 2a1f3ce70365bbc6797f43073d914bb91f86e756)
This commit is contained in:
parent
59beef7e9b
commit
6931a7e32a
37
CVE-2023-37732.patch
Normal file
37
CVE-2023-37732.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
From 2cd3bb50e256f5ed5f611ac611d25fe673f2cec3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Johnson <johnson.peter@gmail.com>
|
||||||
|
Date: Fri, 30 Jun 2023 08:08:55 -0700
|
||||||
|
Subject: [PATCH] elf.c: Fix NULL deref on bad xsize expression (#234)
|
||||||
|
|
||||||
|
---
|
||||||
|
modules/objfmts/elf/elf.c | 10 +++++-----
|
||||||
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c
|
||||||
|
index 67fe3f26..1ee98bfd 100644
|
||||||
|
--- a/modules/objfmts/elf/elf.c
|
||||||
|
+++ b/modules/objfmts/elf/elf.c
|
||||||
|
@@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab,
|
||||||
|
|
||||||
|
/* get size (if specified); expr overrides stored integer */
|
||||||
|
if (entry->xsize) {
|
||||||
|
- size_intn = yasm_intnum_copy(
|
||||||
|
- yasm_expr_get_intnum(&entry->xsize, 1));
|
||||||
|
- if (!size_intn) {
|
||||||
|
+ yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1);
|
||||||
|
+ if (!intn) {
|
||||||
|
yasm_error_set(YASM_ERROR_VALUE,
|
||||||
|
N_("size specifier not an integer expression"));
|
||||||
|
yasm_errwarn_propagate(errwarns, entry->xsize->line);
|
||||||
|
- }
|
||||||
|
+ } else
|
||||||
|
+ size_intn = yasm_intnum_copy(intn);
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
+ if (!size_intn)
|
||||||
|
size_intn = yasm_intnum_create_uint(entry->size);
|
||||||
|
|
||||||
|
/* get EQU value for constants */
|
||||||
|
--
|
||||||
|
2.41.0.windows.3
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: yasm
|
Name: yasm
|
||||||
Version: 1.3.0
|
Version: 1.3.0
|
||||||
Release: 9
|
Release: 10
|
||||||
Summary: NASM assembler
|
Summary: NASM assembler
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://yasm.tortall.net/
|
URL: http://yasm.tortall.net/
|
||||||
@ -9,6 +9,7 @@ Source0: http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
|
|||||||
BuildRequires: gcc bison byacc gettext-devel xmlto
|
BuildRequires: gcc bison byacc gettext-devel xmlto
|
||||||
Provides: bundled(md5-plumb)
|
Provides: bundled(md5-plumb)
|
||||||
|
|
||||||
|
Patch1: CVE-2023-37732.patch
|
||||||
%description
|
%description
|
||||||
Yasm is a complete rewrite of the NASM assembler under the “new” BSD License.
|
Yasm is a complete rewrite of the NASM assembler under the “new” BSD License.
|
||||||
|
|
||||||
@ -46,5 +47,8 @@ rm -rf %{buildroot}
|
|||||||
%{_mandir}/*
|
%{_mandir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 11 2023 liningjie <liningjie@xfusion.com> - 1.3.0-10
|
||||||
|
- fix CVE-2023-37732
|
||||||
|
|
||||||
* Mon Jan 6 2020 qinjian <qinjian18@huawei.com> - 1.3.0-9
|
* Mon Jan 6 2020 qinjian <qinjian18@huawei.com> - 1.3.0-9
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user