Full Disclosure mailing list archives

Re: Evidence of a ISC being hacked?


From: Valdis.Kletnieks () vt edu
Date: Thu, 24 Jun 2004 15:38:27 -0400

On Thu, 24 Jun 2004 11:22:18 PDT, VX Dude said:

Good point, personally I wouldn't think that making a
small wrapper would take that long, but then again I
havent done it, and I havent done it under stress and
a time crunch.  I code for fun and not profit which is
pretty stress free.

Writing a small wrapper doesn't do anything any better than
just using a #define - the *basic* problem is that there's no way
for any wrapper or preprocessor magic to know the "right" answer
to the most crucial difference - vsnprintf takes a 'length' parameter,
and you have 2 basic choices:

1) The wrapper/define/handwaving discards it and prays.

2) The replacement function does a proper job of doing a full enough
emulation of vsnprintf to keep track of "length so far" and stop
when it gets full (not as easy as you might think - for fun, compute
how many bytes this takes:

   vsprintf(target,"%#'LG",foo);

(Note the evilness involved in the ' flag, which is locale-dependent ;)

Attachment: _bin
Description:


Current thread: