bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix or remove %b support in grub_printf()


From: Pavel Roskin
Subject: [PATCH] Fix or remove %b support in grub_printf()
Date: Sun, 02 May 2004 00:18:07 -0400 (EDT)

Hello!

I was looking how to fix a warning about "strict-aliasing rules", but
found a potential bug in grub_printf() instead.  The variable "mask" is
never reset to 0xffffffff once it becomes 0xff.

mask is set to 0xff for "%b" format string, which is not standard.  In
fact, it's not implemented in glibc and gcc warns about it.  I don't see
any occurrences of "%b" in GRUB sources other than in assembly.

I see from the implementation that %b should print a byte.  But the
failure to reset mask would affect the rest of the string.  I think it's
broken unused code.

I've attached two alternative patches.  If %b is not used, it should be
removed.  See remove_percent_b.diff.  If %b is used or may be used, it
would be easier to implement it properly in convert_to_ascii().  See
fix_percent_b.diff.

-- 
Regards,
Pavel Roskin

Attachment: fix_percent_b.diff
Description: Text document

Attachment: remove_percent_b.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]