Skip to content

Commit

Permalink
fix Windows disk drive index comparison
Browse files Browse the repository at this point in the history
Ensures that we are comparing indexes and not pointers to indexes.

Fixes #267

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
  • Loading branch information
jaypipes committed Feb 6, 2023
1 parent 77ab5ed commit 7c8936e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/block/block_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ func (i *Info) load() error {
}
for _, diskpartition := range win32DiskPartitionDescriptions {
// Finding disk partition linked to current disk drive
if diskdrive.Index == diskpartition.DiskIndex {
if diskdrive.Index == nil || diskpartition.DiskIndex == nil {
continue
}
if *diskdrive.Index == *diskpartition.DiskIndex {
disk.PhysicalBlockSizeBytes = *diskpartition.BlockSize
// Finding logical partition linked to current disk partition
for _, logicaldisk := range win32LogicalDiskDescriptions {
Expand Down

0 comments on commit 7c8936e

Please sign in to comment.