naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ff2b41
From 0c25ad023d3864bf55ae7334cbc3da25b9227d18 Mon Sep 17 00:00:00 2001
ff2b41
From: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
ff2b41
Date: Mon, 13 May 2019 18:41:55 +0800
ff2b41
Subject: [PATCH] udev/scsi_id: fix incorrect page length when get device
ff2b41
 identification VPD page
ff2b41
ff2b41
The length of device identification VPD page is filled with two bytes,
ff2b41
but scsi_id only gets the low byte. Fix it.
ff2b41
ff2b41
Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
ff2b41
(cherry picked from commit 1f7b6872dbe8ccae1f3bda9aa6aeb87c9b42e01e)
ff2b41
ff2b41
Resolves: #1635945
ff2b41
---
ff2b41
 src/udev/scsi_id/scsi_serial.c | 2 +-
ff2b41
 1 file changed, 1 insertion(+), 1 deletion(-)
ff2b41
ff2b41
diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c
ff2b41
index dcfff1d4ea..06fb4815b6 100644
ff2b41
--- a/src/udev/scsi_id/scsi_serial.c
ff2b41
+++ b/src/udev/scsi_id/scsi_serial.c
ff2b41
@@ -677,7 +677,7 @@ static int do_scsi_page83_inquiry(struct udev *udev,
ff2b41
                  * Examine each descriptor returned. There is normally only
ff2b41
                  * one or a small number of descriptors.
ff2b41
                  */
ff2b41
-                for (j = 4; j <= (unsigned int)page_83[3] + 3; j += page_83[j + 3] + 4) {
ff2b41
+                for (j = 4; j <= ((unsigned)page_83[2] << 8) + (unsigned)page_83[3] + 3; j += page_83[j + 3] + 4) {
ff2b41
                         retval = check_fill_0x83_id(udev,
ff2b41
                                                     dev_scsi, &page_83[j],
ff2b41
                                                     &id_search_list[id_ind],