Skip to content

Commit

Permalink
udev/scsi_id: fix incorrect page length when get device identificatio…
Browse files Browse the repository at this point in the history
…n VPD page

The length of device identification VPD page is filled with two bytes,
but scsi_id only gets the low byte. Fix it.

Signed-off-by: Zhang Xianwei <[email protected]>

systemd-commit: 1f7b6872dbe8ccae1f3bda9aa6aeb87c9b42e01e
Author: Zhang Xianwei <[email protected]>
Date:   Mon May 13 18:41:55 2019 +0800
  • Loading branch information
bbonev committed Oct 10, 2021
1 parent 21b7ede commit d527ee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scsi_id/scsi_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static int do_scsi_page83_inquiry(struct udev *udev,
* Examine each descriptor returned. There is normally only
* one or a small number of descriptors.
*/
for (j = 4; j <= (unsigned int)page_83[3] + 3; j += page_83[j + 3] + 4) {
for (j = 4; j <= ((unsigned)page_83[2] << 8) + (unsigned)page_83[3] + 3; j += page_83[j + 3] + 4) {
retval = check_fill_0x83_id(udev,
dev_scsi, page_83 + j,
id_search_list + id_ind,
Expand Down

0 comments on commit d527ee5

Please sign in to comment.