From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Sikqf-0002GY-AI for mharc-grub-devel@gnu.org; Sun, 24 Jun 2012 07:19:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sikqc-0002GS-Gs for grub-devel@gnu.org; Sun, 24 Jun 2012 07:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sikqa-0005lF-Rv for grub-devel@gnu.org; Sun, 24 Jun 2012 07:19:18 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:55902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sikqa-0005l9-JJ for grub-devel@gnu.org; Sun, 24 Jun 2012 07:19:16 -0400 Received: by wgbds1 with SMTP id ds1so2187901wgb.30 for ; Sun, 24 Jun 2012 04:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=/8ElrwY3h2vohVfVrVrxnJudP2u44XBYBpCnvOQ+wEI=; b=hUKXItaP4iLfDTwJhg+AJY7OKBnW0jsNHl+eFTC+0mh44Sh8HpXo1ELE2vpSgzM6L3 ZG/UAcgAjnT2gwXtIExvugv1KKMRZCmwKO8TA17QbieuuBy6rQmJgt1puwJwQX1ZJ9t5 uGUQJEr9IdYFcp905DbiVAUn0lQ0DMPpPPjk5EMYVWwNsEl6f/oB/hzD+6R0qKXgnyEG BrSsgCFxQmomOFfkpF+Ex/UJTBEfPche7319tlLYuR1KI8F/c4ZQvhBZich4WaBVx2Bw X/zRCNtzN8v1K61Yklt8eI07/n9IuA2sHJgqjMwb568KJe+kA0dzxwnFk2rj/Cpyshqe 5KPA== Received: by 10.180.80.74 with SMTP id p10mr17058644wix.10.1340536753969; Sun, 24 Jun 2012 04:19:13 -0700 (PDT) Received: from [192.168.1.37] (c2433-1-88-160-112-182.fbx.proxad.net. [88.160.112.182]) by mx.google.com with ESMTPS id ch9sm20992446wib.8.2012.06.24.04.19.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jun 2012 04:19:13 -0700 (PDT) Message-ID: <4FE6F7AF.7080207@gmail.com> Date: Sun, 24 Jun 2012 13:19:11 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 To: The development of GNU GRUB Subject: [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD Content-Type: multipart/mixed; boundary="------------060902080804010806040902" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 11:19:19 -0000 This is a multi-part message in MIME format. --------------060902080804010806040902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, The attached patch fixes grub-probe for NetBSD (the issue was introduced in commit 4068). Grégoire --------------060902080804010806040902 Content-Type: text/x-patch; name="fix-overflow-for-disk-size.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="fix-overflow-for-disk-size.diff" === modified file 'ChangeLog' --- ChangeLog 2012-06-23 20:56:19 +0000 +++ ChangeLog 2012-06-24 11:10:41 +0000 @@ -1,3 +1,10 @@ +2012-06-24 Grégoire Sutre + + Fix overflow. + + * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_size) + [__NetBSD__]: Add explicit cast before bitshift. + 2012-06-23 Vladimir Serbinenko * configure.ac: Bump to 2.00~rc1. === modified file 'grub-core/kern/emu/hostdisk.c' --- grub-core/kern/emu/hostdisk.c 2012-06-07 12:24:48 +0000 +++ grub-core/kern/emu/hostdisk.c 2012-06-24 11:07:23 +0000 @@ -309,7 +309,7 @@ # if defined (__APPLE__) return nr << log_sector_size; # elif defined(__NetBSD__) - return label.d_secperunit << log_sector_size; + return (grub_uint64_t)label.d_secperunit << log_sector_size; # elif defined (__sun__) return minfo.dki_capacity << log_sector_size; # else --------------060902080804010806040902--