|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Subject: Re: StackGuard with ... Re: [Paper] Format bugs.
From: Morten Welinder (terra
DIKU.DK)Date: Mon Jul 24 2000 - 12:48:34 CDT
- Next message: Michael S Hines: "Chasing bugs / vulnerabilties"
- Previous message: Arbitrary Code: "CheckPoint FW-1 4.1 SP 2 Released"
- Maybe in reply to: Alan DeKok: "StackGuard with ... Re: [Paper] Format bugs."
- Next in thread: Ken Alverson: "Re: StackGuard with ... Re: [Paper] Format bugs."
- Maybe reply: Morten Welinder: "Re: StackGuard with ... Re: [Paper] Format bugs."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
mixter
2xs.co.il wrote:
> It is a bad idea to have any format functions accept format
> strings that aren't hard coded at compile time. All these
> functions need to have one format argument at one location,
> which definitely needs to be a hard-coded string, (using and
> enforcing const). Per definition, it is arguably possible to
> supply variable format strings in a program, but it is
> rarely practically used, and it shouldn't be practically
> used. At least, when supplying any format function a
> non-constant format argument, the compiler should spit out a
> big warning, and it should do that by default without
> warnings enabled.
As a guesstimate, three out of four format strings in newer GNU
programs are non-constant. That hardly qualifies as rare. I think
you forgot about internationalisation.
Here's a sample from Gnumeric:
s = g_strdup_printf (
_("Workbook %s has unsaved changes, save them?"),
g_basename (wb->filename));
(Which reminds me: I sure hope that the language files cannot be
controlled by a malicious user. That would allow putting extra
%-escapes into just about any format string. Ugh.)
Morten
- Next message: Michael S Hines: "Chasing bugs / vulnerabilties"
- Previous message: Arbitrary Code: "CheckPoint FW-1 4.1 SP 2 Released"
- Maybe in reply to: Alan DeKok: "StackGuard with ... Re: [Paper] Format bugs."
- Next in thread: Ken Alverson: "Re: StackGuard with ... Re: [Paper] Format bugs."
- Maybe reply: Morten Welinder: "Re: StackGuard with ... Re: [Paper] Format bugs."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]