dmidecode: Fix crash with -u option
Signed-off-by: Yang Yanchao <yangyanchao6@huawei.com> (cherry picked from commit 57e2eac7fbe4e99500bc603a56aadf3f784d3b8e)
This commit is contained in:
parent
806cbbbbf7
commit
a0ec95296d
34
dmidecode-Fix-crash-with-u-option.patch
Normal file
34
dmidecode-Fix-crash-with-u-option.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 11e134e54d15e67a64c39a623f492a28df922517 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jean Delvare <jdelvare@suse.de>
|
||||||
|
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 <jerry.hoemann@hpe.com>
|
||||||
|
Fixes: da06888d08b9 ("dmidecode: Use the print helpers in dump mode too")
|
||||||
|
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
||||||
|
---
|
||||||
|
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.33.0
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: dmidecode
|
Name: dmidecode
|
||||||
Version: 3.3
|
Version: 3.3
|
||||||
Release: 2
|
Release: 3
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Summary: DMI data report tool
|
Summary: DMI data report tool
|
||||||
|
|
||||||
@ -8,6 +8,8 @@ License: GPLv2+
|
|||||||
URL: https://www.nongnu.org/dmidecode/
|
URL: https://www.nongnu.org/dmidecode/
|
||||||
Source0: http://download.savannah.gnu.org/releases/dmidecode/%{name}-%{version}.tar.xz
|
Source0: http://download.savannah.gnu.org/releases/dmidecode/%{name}-%{version}.tar.xz
|
||||||
|
|
||||||
|
Patch1: dmidecode-Fix-crash-with-u-option.patch
|
||||||
|
|
||||||
Patch6000: bugfix-compat_uuid.patch
|
Patch6000: bugfix-compat_uuid.patch
|
||||||
|
|
||||||
BuildRequires: make gcc xz
|
BuildRequires: make gcc xz
|
||||||
@ -50,6 +52,9 @@ make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="%{__global_ldflags}"
|
|||||||
%{_mandir}/man8/*.8.gz
|
%{_mandir}/man8/*.8.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 24 2022 Yang Yanchao <yangyanchao6@huawei.com> - 3.3-3
|
||||||
|
- dmidecode: Fix crash with -u option
|
||||||
|
|
||||||
* Sat Jan 29 2022 Yang Yanchao <yangyanchao6@huawei.com> - 3.3-2
|
* Sat Jan 29 2022 Yang Yanchao <yangyanchao6@huawei.com> - 3.3-2
|
||||||
- add command --compat-uuid
|
- add command --compat-uuid
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user