lvm2/0124-device_id-fix-checking-wrong-buffer-after-format_gen.patch
Marian Csontos 0d41e7e8af Additional patches for 9.9.0 lvm2
Patches from upstream up to 2.03.41.

Resolves: RHEL-174324
2026-06-04 21:29:42 +02:00

32 lines
1022 B
Diff

From e106d5239e4687f27cefff9812b3028111df6838 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Fri, 3 Apr 2026 08:59:00 +0200
Subject: [PATCH 124/211] device_id: fix checking wrong buffer after
format_general_id
Check outbuf (the output buffer) instead of buf (the input buffer)
after format_general_id, matching the correct pattern at line 805.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 4116375f61cad895d0bce2f2ff0ee03ef5188e85)
---
lib/device/device_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 6ec8f43ba..a55074c3c 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -821,7 +821,7 @@ static int _dev_read_sys_serial(struct cmd_context *cmd, struct device *dev,
ret = 0;
if (ret) {
format_general_id((const char *)buf, sizeof(buf), (unsigned char *)outbuf, outbufsize);
- if (buf[0])
+ if (outbuf[0])
return 1;
}
}
--
2.54.0