All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD
@ 2012-06-24 11:19 Grégoire Sutre
  2012-06-24 18:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 3+ messages in thread
From: Grégoire Sutre @ 2012-06-24 11:19 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-25  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-24 11:19 [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD Grégoire Sutre
2012-06-24 18:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-25  8:14   ` Grégoire Sutre

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.