This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C11 bounds checking interfaces in glibc?


2012/2/15 Andi Kleen <andi@firstfloor.org>:
> On Wed, Feb 15, 2012 at 09:11:18PM +0000, Joseph S. Myers wrote:
>> I don't think there are any plans; see
>> <http://sourceware.org/ml/libc-alpha/2011-12/msg00066.html> for what I
>> said about them and
>> <http://sourceware.org/ml/libc-alpha/2011-12/msg00064.html> for what
>> Roland said. ?In essence, they are rather a mess and *most* of them (other
>> than the reentrant functions) probably are not desirable for use in new
>> code - but there are probably uses for them for compiling some existing
>> bodies of code that have been retrofitted with them.
>
> So how do we get string functions with overflow checking instead?
>
> Is the general recommendation everyone has to use libbsd now?
>
> It's mainly of me being sick of writing
>
> #define strlcpy(d,s,l) snprintf(d,l,"%s",s), d
>
> everywhere. strcpy_s/strncpy_s/strcat_s seemed like reasonable
> replacements.

strl* functions are best, I think. Nowadays, really really much open source
products are using their functions and they are not safe when running on linux
because they often have wrong stub functions. That have made several unfortunate
thing. It would be very nice if glibc can support strl* too.

Of course, that's completely my personal opinion...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]