use of %n in genmodes.c causes trouble on Vista

Aaron Gray angray@beeb.net
Thu Jun 7 03:04:00 GMT 2007


>> I think a sprintf followed by a strlen and printf is _guarenteed_ to be 
>> much
>> more portable than printf's return value. The overhead of the strlen is
>> minimal.
>
> Maybe portable, but how do you choose the length of the buffer to pass
> to sprintf!  Ironic: we'd be trading a mostly-bogus security issue for
> a buffer overflow problem.

snprintf (from libiberty) ?

we should maybe check the maximum length of identifiers anyway ?

This thing is really trivial security wise anyway.

Aaron



More information about the Gcc mailing list