From: Sami Liedes <sami.liedes@iki.fi>
To: linux-ext4@vger.kernel.org
Subject: [PATCH 7/8] lib/ext2fs/qcow2.h: Fix #defined 1<<63 values to be unsigned.
Date: Fri, 14 Dec 2012 00:04:31 +0200 [thread overview]
Message-ID: <20121213220431.GO9713@sli.dy.fi> (raw)
In-Reply-To: <cover.1355435985.git.sami.liedes@iki.fi>
QCOW_OFLAG_COPIED in qcow2.h and e2image.c was defined as a signed
value, which however does not fit in a signed 64-bit integer.
Caught by clang -fsanitize=undefined.
Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
---
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 81e0ec9..b997653 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 (1LLU << 63)
+#define QCOW_OFLAG_COMPRESSED (1LLU << 62)
#define QCOW_COMPRESSED 1
#define QCOW_ENCRYPTED 2
diff --git a/misc/e2image.c b/misc/e2image.c
index e6ea52a..36769c1 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -47,7 +47,7 @@ extern int optind;
#include "../version.h"
#include "nls-enable.h"
-#define QCOW_OFLAG_COPIED (1LL << 63)
+#define QCOW_OFLAG_COPIED (1LLU << 63)
const char * program_name = "e2image";
--
1.7.10.4
next prev parent reply other threads:[~2012-12-13 22:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1355435985.git.sami.liedes@iki.fi>
2012-12-13 22:04 ` [PATCH 1/8] lib/blkid/list.h: Fix undefined behavior in list_entry() macro Sami Liedes
2012-12-13 22:04 ` [PATCH 2/8] lib/ext2fs/rbtree.h: Fix container_of() undefined behavior Sami Liedes
2012-12-13 22:04 ` [PATCH 3/8] e2fsck/pass1.c: Fix undefined behavior in check_blocks() Sami Liedes
2012-12-13 22:04 ` [PATCH 4/8] lib/ext2fs/block.c: Fix undefined behavior in block_iterate_tind() Sami Liedes
2012-12-13 22:04 ` [PATCH 5/8] e2fsck/revoke.c: Fix undefined behavior in hash() Sami Liedes
2012-12-13 22:04 ` [PATCH 6/8] lib/ext2fs/kernel-list.h: Fix undefined behavior in list_entry() macro Sami Liedes
2012-12-13 22:04 ` Sami Liedes [this message]
2012-12-13 22:04 ` [PATCH 8/8] e2fsck/jfs_user.h: Fix b_data alignment in struct buffer_head Sami Liedes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121213220431.GO9713@sli.dy.fi \
--to=sami.liedes@iki.fi \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.