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: Eric Blake
Subject: Re: url's in --help output
Date: Mon, 02 Feb 2009 06:33:05 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmG9hEACgkQ84KuGfSFAYBD2QCcCpM5F380eY/QnjiEViOetb0B
P+8AnRSgpQ17rV/n7Dd4ONDBRk/jvCG0
=YTXf
-----END PGP SIGNATURE-----




reply via email to

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