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: asprintf() issue


On 05/20/2015 06:30 AM, Carlos O'Donell wrote:

>> I don't think this is worth the cost.  (Even such little changes add up
>> and eventually impact linking time and code size.)  It does not even fix
>> a bug, and application code can easily set *ptr to NULL before calling
>> asprintf, to get uniform behavior across all known implementations (if
>> that simplifies application code).
> 
> I disagree that the compat symbol is not worth the cost.
> 
> Such a change stands to break binaries that were previously working, and in 
> glibc we stand by our community commitment not to break user code.

Sorry, I've now realized what I wrote was unclear.  I meant that if we
make such a minor change (without clear improvement for developers, in
my opinion), and it needs a compat symbol (which is the case here, I
agree), then making the change may not be worth it.

> I think we should do the following:
> 
> (a) Rewrite the man page to say we set the pointer to NULL on error.
>     Document that this behaviour changed in glibc 2.22.
> 
> (b) Add a versioned function to support old binaries, and have the 
>     new implementation set the pointer to NULL on error.
> 
> Then we're done and move on to the next problem.

If that's the emerging consensus, it's something with which I can agree.

-- 
Florian Weimer / Red Hat Product Security


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