diff --git a/SOURCES/0024-dmidecode-Fix-crash-with-u-option.patch b/SOURCES/0024-dmidecode-Fix-crash-with-u-option.patch new file mode 100644 index 0000000..a955edc --- /dev/null +++ b/SOURCES/0024-dmidecode-Fix-crash-with-u-option.patch @@ -0,0 +1,34 @@ +From 11e134e54d15e67a64c39a623f492a28df922517 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 19 Jan 2021 16:26:01 +0100 +Subject: [PATCH] dmidecode: Fix crash with -u option + +A segmentation fault was reported with option -u. Turns out to be a +stupid thinko where the buffer offset was reset at the wrong loop +depth. + +Reported-by: Jerry Hoemann +Fixes: da06888d08b9 ("dmidecode: Use the print helpers in dump mode too") +Signed-off-by: Jean Delvare +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 572cb1a..69ea0e8 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -248,9 +248,9 @@ static void dmi_dump(const struct dmi_header *h) + { + int j, l = strlen(s) + 1; + +- off = 0; + for (row = 0; row < ((l - 1) >> 4) + 1; row++) + { ++ off = 0; + for (j = 0; j < 16 && j < l - (row << 4); j++) + off += sprintf(raw_data + off, + j ? " %02X" : "%02X", +-- +2.31.0 + diff --git a/SPECS/dmidecode.spec b/SPECS/dmidecode.spec index 8083f34..b4a3087 100644 --- a/SPECS/dmidecode.spec +++ b/SPECS/dmidecode.spec @@ -1,7 +1,7 @@ Summary: Tool to analyse BIOS DMI data Name: dmidecode Version: 3.2 -Release: 8%{?dist} +Release: 10%{?dist} Epoch: 1 License: GPLv2+ Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz @@ -51,6 +51,7 @@ Patch40: 0023-Allow-overriding-build-settings-from-the-environment.patch Patch41: 0001-dmidecode-Add-new-system-slot-types-from-SMBIOS-spec.patch Patch42: 0002-dmidecode-Skip-details-of-uninstalled-memory-modules.patch Patch43: RHELonly-Missing-comma-in-the-dmi_slot_type.patch +Patch44: 0024-dmidecode-Fix-crash-with-u-option.patch BuildRequires: gcc make ExclusiveArch: %{ix86} x86_64 ia64 aarch64 @@ -112,6 +113,7 @@ I/O ports (e.g. serial, parallel, USB). %patch41 -p1 %patch42 -p1 %patch43 -p1 +%patch44 -p1 %build make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" @@ -132,6 +134,10 @@ make %{?_smp_mflags} DESTDIR=%{buildroot} prefix=%{_prefix} install-bin install- %{_mandir}/man8/* %changelog +* Fri Apr 9 2021 Coiby Xu - 1:3.2-10 +- Fix crash with -u option +- Resolves: rhbz#1885823 + * Thu Dec 10 2020 Lianbo Jiang - 1:3.2-8 - CI found an error in the commit , need to fix it. - Resolves: rhbz#1858350