All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grégoire Sutre" <gregoire.sutre@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD
Date: Sun, 24 Jun 2012 13:19:11 +0200	[thread overview]
Message-ID: <4FE6F7AF.7080207@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

Hi,

The attached patch fixes grub-probe for NetBSD (the issue was
introduced in commit 4068).

Grégoire

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-overflow-for-disk-size.diff --]
[-- Type: text/x-patch; name="fix-overflow-for-disk-size.diff", Size: 890 bytes --]

=== 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  <gregoire.sutre@gmail.com>
+
+	Fix overflow.
+
+	* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_size)
+	[__NetBSD__]: Add explicit cast before bitshift.
+
 2012-06-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
 	* 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


             reply	other threads:[~2012-06-24 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-24 11:19 Grégoire Sutre [this message]
2012-06-24 18:31 ` [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-25  8:14   ` Grégoire Sutre

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=4FE6F7AF.7080207@gmail.com \
    --to=gregoire.sutre@gmail.com \
    --cc=grub-devel@gnu.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.