bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: url's in --help output


From: Simon Josefsson
Subject: Re: url's in --help output
Date: Mon, 02 Feb 2009 14:45:44 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Eric Blake <address@hidden> writes:

> According to Simon Josefsson on 2/2/2009 5:16 AM:
>>> In m4, I was using xprintf instead of printf.  Is it worth the extra
>>> security here?  printf can fail for reasons like ENOMEM which do not set
>>> the ferror flag and thus are not caught by the close_stdout atexit module,
>>> so a robust program should be checking for failures.
>> 
>> Does this problem occur in practice on any modern platform?
>
> Yes - Jim noticed real problems on a GNU/Linux system when implementing
> printf(1), where the printf(3) failed due to malloc failure without
> printing any output, but also without setting the stream error indicator,
> such that printf(1) exited with status 0.  Which is why he implemented
> xprintf in the first place.  On the other hand, the failure scenario is
> more likely to occur when using formats that produce lots of output (large
> precisions), or convert floating point to decimal, neither of which should
> be the case for these statements.

So maybe the answer really is no, then, at least as far as this code is
concerned?

Is this something the gnulib printf module can detect and work around?

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]