OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: ftpd and setproctitle()
From: Bernd Luevelsmeyer (bernd.luevelsmeyerHEITEC.NET)
Date: Fri Jul 07 2000 - 17:50:29 CDT


D. J. Bernstein wrote:
[...]
> The solution is to eliminate the interface. Design a new interface that
> doesn't encourage bugs. Then make sure that everyone switches to the new
> interface. Advertise the new interface. Make the old interface more and
> more difficult to use. Move gets() to /usr/lib/libbugpronestandards.a.
[...]

For this class of bugs, shouldn't it be possible to modify the compiler
so it will flag any occurrence of a non-constant format string in
printf()-like functions? I mean, an optional warning if the compiler
can't determine the format string's contents at compile time.
GCC has -Wformat already, which might be upgradeable; and there's
__attribute__((format)) to mark printf-like functions.
Even if user-written functions are not marked with the __attribute__,
calls to functions in the compiler's library could at least be checked.