From 849eb9df0a07770a9494ce9e0fdceb6a351be1ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 1 Oct 2023 13:57:43 +0200 Subject: [PATCH] libblkid: (drbd) avoid unaligned accesses MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- libblkid/src/superblocks/drbd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libblkid/src/superblocks/drbd.c b/libblkid/src/superblocks/drbd.c index 2adf5089b3..baead1d78a 100644 --- a/libblkid/src/superblocks/drbd.c +++ b/libblkid/src/superblocks/drbd.c @@ -137,8 +137,8 @@ static int probe_drbd_84(blkid_probe pr, const struct blkid_idmag *mag) * notion of uuids (64 bit, see struct above) */ blkid_probe_sprintf_uuid(pr, - (unsigned char *) &md->device_uuid, sizeof(md->device_uuid), - "%" PRIx64, be64_to_cpu(md->device_uuid)); + member_ptr(md, device_uuid), sizeof(md->device_uuid), + "%" PRIx64, be64_to_cpu(read_unaligned_member(md, device_uuid))); blkid_probe_set_version(pr, "v08"); @@ -158,8 +158,8 @@ static int probe_drbd_90(blkid_probe pr, const struct blkid_idmag *mag) * notion of uuids (64 bit, see struct above) */ blkid_probe_sprintf_uuid(pr, - (unsigned char *) &md->device_uuid, sizeof(md->device_uuid), - "%" PRIx64, be64_to_cpu(md->device_uuid)); + member_ptr(md, device_uuid), sizeof(md->device_uuid), + "%" PRIx64, be64_to_cpu(read_unaligned_member(md, device_uuid))); blkid_probe_set_version(pr, "v09"); -- 2.47.2