valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0761-udev-scsi_id-fix-incorrect-page-length-when-get-devi.patch

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