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/12/2015 03:53 PM, Archie Cobbs wrote:
> Hello,
> 
> I have a question about asprintf(). There seems to be a practical issue with it.
> 
> The man page states:
> 
>     If memory allocation wasn't possible, or some other error
>     occurs, these functions will return -1, and the contents
>     of strp is undefined.
> 
> Note the "strp is undefined" part. This is correct, because there is
> apparently no explicit specification that says anything otherwise.

The glibc manual strongly implies that *strp is not updated on error,
and the code implements that.

The quoted manual page looks wrong.  You can file a bug here:

<https://bugzilla.kernel.org/enter_bug.cgi?component=man-pages&product=Documentation>

-- 
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]