From patchwork Thu Dec 13 22:04:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Liedes X-Patchwork-Id: 206261 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0E1282C0086 for ; Fri, 14 Dec 2012 09:39:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750755Ab2LMWi5 (ORCPT ); Thu, 13 Dec 2012 17:38:57 -0500 Received: from smtp-3.hut.fi ([130.233.228.93]:57571 "EHLO smtp-3.hut.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877Ab2LMWiz (ORCPT ); Thu, 13 Dec 2012 17:38:55 -0500 Received: from localhost (katosiko.hut.fi [130.233.228.115]) by smtp-3.hut.fi (8.13.6/8.12.10) with ESMTP id qBDM4fTn019960 for ; Fri, 14 Dec 2012 00:04:41 +0200 Received: from smtp-3.hut.fi ([130.233.228.93]) by localhost (katosiko.hut.fi [130.233.228.115]) (amavisd-new, port 10024) with LMTP id 30627-1411 for ; Fri, 14 Dec 2012 00:04:41 +0200 (EET) Received: from kosh.localdomain (kosh.hut.fi [130.233.228.12]) by smtp-3.hut.fi (8.13.6/8.12.10) with ESMTP id qBDM4W8e019948 for ; Fri, 14 Dec 2012 00:04:32 +0200 Received: by kosh.localdomain (Postfix, from userid 43888) id 181134BA; Fri, 14 Dec 2012 00:04:32 +0200 (EET) Date: Fri, 14 Dec 2012 00:04:31 +0200 From: Sami Liedes To: linux-ext4@vger.kernel.org Subject: [PATCH 7/8] lib/ext2fs/qcow2.h: Fix #defined 1<<63 values to be unsigned. Message-ID: <20121213220431.GO9713@sli.dy.fi> Mail-Followup-To: linux-ext4@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TKK-Virus-Scanned: by amavisd-new-2.1.2-hutcc at katosiko.hut.fi Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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";