e2fsprogs/SOURCES/e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch
2021-09-09 16:15:39 +00:00

43 lines
1.2 KiB
Diff

From d7968909c6b503c3c96d36ae2a686b1b07308077 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Mon, 4 Nov 2019 21:22:54 -0500
Subject: [PATCH 03/10] Fix UBSan when shifting (1LL << 63)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
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 5576348a..b649c9cf 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 3c881fee..30f25432 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 */
--
2.21.1