[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit.
From: |
Pavel Roskin |
Subject: |
Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit. |
Date: |
Sun, 12 Apr 2009 17:33:35 -0400 |
On Sun, 2009-04-12 at 14:46 +0200, phcoder wrote:
> - grub_itoa (tmp, c, n);
> + grub_lltoa (tmp, c, n);
Wrong. For "x" and "u" specifiers, the value is unsigned int, but n is
signed int. If we extend signed into to unsigned long long, we get a
sign extension that would be incorrect.
Suppose the argument is 0xffffffff. n would be -1. grub_lltoa() would
get (unsigned long long)-1, that is 0xffffffffffffffff.
If the type is going to be converted, we need to treat signed and
unsigned values separately.
--
Regards,
Pavel Roskin
- [PATCH]: grub: Fix handling of long printf arguments on 64-bit., David Miller, 2009/04/11
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Yoshinori K. Okuji, 2009/04/11
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., David Miller, 2009/04/11
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., phcoder, 2009/04/11
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Pavel Roskin, 2009/04/11
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., David Miller, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., phcoder, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Isaac Dupree, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Pavel Roskin, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit.,
Pavel Roskin <=
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Pavel Roskin, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., phcoder, 2009/04/12
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Pavel Roskin, 2009/04/13
- Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., phcoder, 2009/04/15
Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit., Pavel Roskin, 2009/04/12