parted/0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch
DistroBaker b7125dc640 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/parted.git#633c371306f0da38c70879e948b612775032740a
2020-12-01 18:08:09 +00:00

34 lines
1.1 KiB
Diff

From 006ad756c70603212309157fa05c5d855e25f07e Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 12 Nov 2020 13:33:36 -0800
Subject: [PATCH 29/42] hfs/hfs: Fix gcc 10 warnings about cast alignment
---
libparted/fs/r/hfs/hfs.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
index 0aababd..09899da 100644
--- a/libparted/fs/r/hfs/hfs.c
+++ b/libparted/fs/r/hfs/hfs.c
@@ -891,12 +891,11 @@ hfsplus_wrapper_update (PedFileSystem* fs)
ref.record_number = 1;
}
- ref.record_pos =
- PED_BE16_TO_CPU (*((uint16_t *)
- (node + (PED_SECTOR_SIZE_DEFAULT
- - 2*ref.record_number))));
+ uint16_t value;
+ memcpy(&value, node+PED_SECTOR_SIZE_DEFAULT - (2*ref.record_number), sizeof(uint16_t));
+ ref.record_pos = PED_BE16_TO_CPU(value);
ret_key = (HfsExtentKey*) (node + ref.record_pos);
- ret_data = (HfsExtDescriptor*) ( node + ref.record_pos
+ ret_data = (HfsExtDescriptor*) (node + ref.record_pos
+ sizeof (HfsExtentKey) );
}
--
2.26.2