cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
05ad79
From a569050329d914ad5aa15978f2a4a3d969c7c8b1 Mon Sep 17 00:00:00 2001
05ad79
From: Boris Egorov <egorov@linux.com>
05ad79
Date: Tue, 19 Jan 2016 11:37:57 +0600
05ad79
Subject: [PATCH 113/116] libblkid: (zfs) add cast to fix UB [cppcheck]
05ad79
05ad79
[libblkid/src/superblocks/zfs.c:173]: (error) Shifting 32-bit value by 56 bits is undefined behaviour
05ad79
[libblkid/src/superblocks/zfs.c:173]: (error) Shifting 32-bit value by 40 bits is undefined behaviour
05ad79
05ad79
Upstream: https://github.com/karelzak/util-linux/commit/18b76be61c11fd5f11fcb84aa6a946d3b03d7225
05ad79
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1392661
05ad79
Signed-off-by: Karel Zak <kzak@redhat.com>
05ad79
---
05ad79
 libblkid/src/superblocks/zfs.c | 2 +-
05ad79
 1 file changed, 1 insertion(+), 1 deletion(-)
05ad79
05ad79
diff --git a/libblkid/src/superblocks/zfs.c b/libblkid/src/superblocks/zfs.c
05ad79
index 5074495..ff12fa6 100644
05ad79
--- a/libblkid/src/superblocks/zfs.c
05ad79
+++ b/libblkid/src/superblocks/zfs.c
05ad79
@@ -170,7 +170,7 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset)
05ad79
 
05ad79
 static int find_uberblocks(const void *label, loff_t *ub_offset, int *swap_endian)
05ad79
 {
05ad79
-	uint64_t swab_magic = swab64(UBERBLOCK_MAGIC);
05ad79
+	uint64_t swab_magic = swab64((uint64_t)UBERBLOCK_MAGIC);
05ad79
 	struct zfs_uberblock *ub;
05ad79
 	int i, found = 0;
05ad79
 	loff_t offset = VDEV_LABEL_UBERBLOCK;
05ad79
-- 
05ad79
2.9.3
05ad79