|
| 1 | +From a8196f22eccfd6e2b934dfdb4f8dac97d7e6c1f3 Mon Sep 17 00:00:00 2001 |
| 2 | +From: akhila-guruju <v-guakhila@microsoft.com> |
| 3 | +Date: Wed, 14 May 2025 07:35:12 +0000 |
| 4 | +Subject: [PATCH] Address CVE-2023-37732 |
| 5 | + |
| 6 | +Upstream patch reference: https://github.com/yasm/yasm/commit/2cd3bb50e256f5ed5f611ac611d25fe673f2cec3 |
| 7 | + |
| 8 | +--- |
| 9 | + modules/objfmts/elf/elf.c | 10 +++++----- |
| 10 | + 1 file changed, 5 insertions(+), 5 deletions(-) |
| 11 | + |
| 12 | +diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c |
| 13 | +index 2486bba..bab4c9c 100644 |
| 14 | +--- a/modules/objfmts/elf/elf.c |
| 15 | ++++ b/modules/objfmts/elf/elf.c |
| 16 | +@@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, |
| 17 | + |
| 18 | + /* get size (if specified); expr overrides stored integer */ |
| 19 | + if (entry->xsize) { |
| 20 | +- size_intn = yasm_intnum_copy( |
| 21 | +- yasm_expr_get_intnum(&entry->xsize, 1)); |
| 22 | +- if (!size_intn) { |
| 23 | ++ yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1); |
| 24 | ++ if (!intn) { |
| 25 | + yasm_error_set(YASM_ERROR_VALUE, |
| 26 | + N_("size specifier not an integer expression")); |
| 27 | + yasm_errwarn_propagate(errwarns, entry->xsize->line); |
| 28 | +- } |
| 29 | ++ } else |
| 30 | ++ size_intn = yasm_intnum_copy(intn); |
| 31 | + } |
| 32 | +- else |
| 33 | ++ if (!size_intn) |
| 34 | + size_intn = yasm_intnum_create_uint(entry->size); |
| 35 | + |
| 36 | + /* get EQU value for constants */ |
| 37 | +-- |
| 38 | +2.45.2 |
| 39 | + |
0 commit comments