From 0a6d02cb67c2f6d28d8d99f6781e898a73fb9e8a Mon Sep 17 00:00:00 2001 From: Pawan Prakash Sharma Date: Mon, 27 Jun 2022 12:39:16 +0530 Subject: [PATCH] fix(crash): fix the crash in parsing the device (#55) Signed-off-by: Pawan --- pkg/device/device-util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/device/device-util.go b/pkg/device/device-util.go index 46095fe..451ae35 100644 --- a/pkg/device/device-util.go +++ b/pkg/device/device-util.go @@ -498,7 +498,7 @@ func getDiskList() ([]diskDetail, error) { // a sample blockDeviceEntry entry look like // sdb 8:16 0 17179869184 0 disk tmp := strings.Fields(blockDeviceEntry) - if len(tmp) == 0 { + if len(tmp) <= lsblkDevTypeIndex { continue }