|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Richard Henderson (rth
REDHAT.COM)Date: Thu Apr 05 2001 - 15:46:23 CDT
On Thu, Apr 05, 2001 at 01:34:33PM -0700, Zack Weinberg wrote:
> Hm, but can you exploit that in the real world?
Dunno. I was thinking of sprintf type attacks with %s, but the fix for
that of course is always use snprintf.
Probably the best solution to this is to not do ugly things with data in
text sections, nor hidden parameters, but to redefine printf as a macro:
#define printf(FMT, ...) \
xprintf(check_it(__VA_LIST__), (FMT), ## __VA_LIST__)
where check_it could be one of those awful macro hacks that counts
parameters, or it could be a new builtin that returns a char array
(aka string constant) of enum type_class values. Or something.
r~
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]