[DGD] Re: sprintf

Kirk Turner kirk.turner at wagoonline.com
Fri Apr 2 13:02:27 CEST 2004


On Fri, 2004-04-02 at 17:44, Bart van Leeuwen wrote:
> On Thu, 1 Apr 2004, Robert Forshaw wrote:
> 
> I am kindof happy not having a binary implementation.. tho it is quite
> possible to do it well, 
I'd be curious to know how it is done. I was having a look at this issue
today, and the problem that I couldn't overcome without writing assembly
was passing the array of data to the variable argument function without
having a huge switch statement calling snprintf with the appropriate
number of arguments.

I'm not a C guru, but using the dgd extensions I couldn't see an easy
way of doing it. Unless you mean implementing the equivalent snprintf
code in C, rather than using the system libraries (much the same as the
lower_case function in the example doesn't call tolower).

Kirk

> I have seen too many drivers that were vulnerable
> to format string related bugs with serious security consequences, and its
> not that hard to do it right, but so much easier to do it wrong ;P
> 
> Bart
> 
> _________________________________________________________________
> List config page:  http://list.imaginary.com/mailman/listinfo/dgd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://mail.dworkin.nl/pipermail/dgd/attachments/20040402/d85b0fe5/attachment.sig>


More information about the DGD mailing list