This is the mail archive of the libc-alpha@sources.redhat.com 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: I: [PATCH] asprintf error handling fix


"Dmitry V. Levin" <ldv@alt-linux.org> writes:

> On Thu, Dec 06, 2001 at 01:02:06AM -0800, Ulrich Drepper wrote:
>> > - When _IO_vfprintf call fails, _IO_vasprintf returns error code without
>> >   freeing memory allocated before (either in this function or during
>> >   _IO_vfprintf execution).
>> 
>> OK, I've changed that.  Slightly different, though.
>
> Your changes are also OK.
> Thank you for fast response.
>
>> > - When either malloc or _IO_vfprintf call fails, _IO_vasprintf returns
>> >   error code without setting result_ptr to zero.
>> 
>> That's nonsense.  The code never did this and there is no reason to
>> ever do this.
>
> I didn't get your point - you are rejecting API extension just because it
> wasn't here before? Well, a lot of features wasn't here before but will
> appear in the future. Or maybe you did a feature freeze in glibc?

You propose an extension?  That wasn't clear from your email.  If you
like to make such changes, you should communicate it better.  Please
note that it's always best to separate bug fixes (and that's how this
email is titled) and enhancements.

> I'm arguing for this feature because it:
> + cannot harm or lead to negative effects;
> + costs nothing;
> + may help to make software a bit more reliable without additional
>   programmer and audit efforts;
> + provides compatibility.
>
> I see four pros and no contras so far.

And the same software will break on older glibc systems or non-glibc
systems since people depend on this.  People have to check the error
code and cannot rely on this behaviour.  It might even make fixing the
bug (not checking asprintf error) even harder to find the bug because
it occurs later...

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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