Blame SOURCES/0007-dmidecode-Fix-crash-with-u-option.patch

e96b51
From 11e134e54d15e67a64c39a623f492a28df922517 Mon Sep 17 00:00:00 2001
e96b51
From: Jean Delvare <jdelvare@suse.de>
e96b51
Date: Tue, 19 Jan 2021 16:26:01 +0100
e96b51
Subject: [PATCH] dmidecode: Fix crash with -u option
e96b51
e96b51
A segmentation fault was reported with option -u. Turns out to be a
e96b51
stupid thinko where the buffer offset was reset at the wrong loop
e96b51
depth.
e96b51
e96b51
Reported-by: Jerry Hoemann <jerry.hoemann@hpe.com>
e96b51
Fixes: da06888d08b9 ("dmidecode: Use the print helpers in dump mode too")
e96b51
Signed-off-by: Jean Delvare <jdelvare@suse.de>
e96b51
---
e96b51
 dmidecode.c | 2 +-
e96b51
 1 file changed, 1 insertion(+), 1 deletion(-)
e96b51
e96b51
diff --git a/dmidecode.c b/dmidecode.c
e96b51
index 572cb1a..69ea0e8 100644
e96b51
--- a/dmidecode.c
e96b51
+++ b/dmidecode.c
e96b51
@@ -248,9 +248,9 @@ static void dmi_dump(const struct dmi_header *h)
e96b51
 			{
e96b51
 				int j, l = strlen(s) + 1;
e96b51
 
e96b51
-				off = 0;
e96b51
 				for (row = 0; row < ((l - 1) >> 4) + 1; row++)
e96b51
 				{
e96b51
+					off = 0;
e96b51
 					for (j = 0; j < 16 && j < l - (row << 4); j++)
e96b51
 						off += sprintf(raw_data + off,
e96b51
 						       j ? " %02X" : "%02X",
e96b51
-- 
e96b51
2.31.0
e96b51