From 6dac306792b98ae9111e8da2b2f4341592812c5a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 4 Nov 2019 21:22:54 -0500 Subject: [PATCH] Fix UBSan when shifting (1LL << 63) Signed-off-by: Theodore Ts'o --- lib/ext2fs/qcow2.h | 4 ++-- misc/e2image.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ext2fs/qcow2.h b/lib/ext2fs/qcow2.h index 5576348..b649c9c 100644 --- a/lib/ext2fs/qcow2.h +++ b/lib/ext2fs/qcow2.h @@ -30,8 +30,8 @@ #define QCOW_MAGIC (('Q' << 24) | ('F' << 16) | ('I' << 8) | 0xfb) #define QCOW_VERSION 2 -#define QCOW_OFLAG_COPIED (1LL << 63) -#define QCOW_OFLAG_COMPRESSED (1LL << 62) +#define QCOW_OFLAG_COPIED (1ULL << 63) +#define QCOW_OFLAG_COMPRESSED (1ULL << 62) #define QCOW_COMPRESSED 1 #define QCOW_ENCRYPTED 2 diff --git a/misc/e2image.c b/misc/e2image.c index 3c881fe..30f2543 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -54,7 +54,7 @@ extern int optind; #include "support/plausible.h" #include "../version.h" -#define QCOW_OFLAG_COPIED (1LL << 63) +#define QCOW_OFLAG_COPIED (1ULL << 63) #define NO_BLK ((blk64_t) -1) /* Image types */ -- 1.8.3.1