* [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
* Re: [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD
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
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-06-24 18:31 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
On 24.06.2012 13:19, Grégoire Sutre wrote:
> - return label.d_secperunit << log_sector_size;
> + return (grub_uint64_t)label.d_secperunit << log_sector_size;
Please add a space after ). Otherwise go ahead.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix overflow in grub_util_get_fd_size for NetBSD
2012-06-24 18:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-06-25 8:14 ` Grégoire Sutre
0 siblings, 0 replies; 3+ messages in thread
From: Grégoire Sutre @ 2012-06-25 8:14 UTC (permalink / raw)
To: The development of GNU GRUB
On 06/24/2012 08:31 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 24.06.2012 13:19, Grégoire Sutre wrote:
>
>> - return label.d_secperunit<< log_sector_size;
>> + return (grub_uint64_t)label.d_secperunit<< log_sector_size;
>
> Please add a space after ). Otherwise go ahead.
Done.
Grégoire
^ 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.