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:

> I'm talking about already written software which rely on zeroing
> result_ptr.

There is no such software using glibc.  Changing this (which is
completely unnecessary) will create an incompatibility.  Newly
developed code might check only for the NULL pointer value and these
programs would then fail with older glibc versions.

> In this case no: former asprintf implementation in bad written program
> usually results to free(unitialized_pointer), while suggested feature will
> lead to free(0). See the difference?

Crap.  If the return value says "failed; don't use the result" you
cannot use the pointer value.  It's that easy.  The interface is
completely in line with other interfaces which behave the same.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


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