-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Andreas Schwab on 10/19/2007 6:58 AM: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> Could it be a bug in printf for failing, yet not setting the >> stream-failure indicator that is checked by close_stdout's ferror? > > A failure from printf does not necessarily mean an output failure. It > can also be ENOMEM or EILSEQ, which are unrelated to output.
Wow. You're right. Which means the return value of printf/fprintf must always be checked in a secure program. It looks like m4 has some bugs in this area (admittedly corner case, since it is not on user-provided strings with large padding values, so the likelihood of running out of memory exactly during the printf is smaller)... Would it be worth a xprintf and xfprintf gnulib wrapper that exits the program immediately on non-output errors from the wrapped printf/fprintf? - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHGK8c84KuGfSFAYARAvJFAKC0hVnovKl3pf33BBWqle4M1hxw0QCfYmFq e70Lu8UzXwKYZx7S5LOZMF8= =0lbq -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils