grub-devel
[Top][All Lists]
Advanced

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

Re: [RFC] Is it okay to just use GNU extensions or should an alternative


From: Vesa Jääskeläinen
Subject: Re: [RFC] Is it okay to just use GNU extensions or should an alternative be provided too?
Date: Sat, 16 Aug 2008 15:54:45 +0300
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Felix Zielcke wrote:
> But yeah maybe there's even in the kernel a use for asprintf,
> so maybe a good idea to make a grub_asprintf?
> This could be then either always used even if the util/*.c use the
> library functions normally or it could be done as with my
> grub_print_error change :)

It would be security feature to use automatic allocation of the memory
for needed amount of the memory. Then it is not possible to do buffer
overflow with those functions. So I have nothing against that. And in
anyway it is only small wrapper to snprintf and malloc so size impact
should not be too big either. Perhaps it can save space later on.

But about using string formatters from different systems can be
problematic. As on some systems differ what different specifiers do.
Good examples are cases where string can be wide char or ansi, or where
length of the integer can change.

When using it with grub's own formatters we know exactly how they perform.




reply via email to

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