From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 766e3204 for ; Mon, 21 Aug 2017 10:43:28 -0500 (EST) Date: Mon, 21 Aug 2017 10:43:28 -0500 (EST) Message-Id: <8262650916751713110.enqueue@fantadrom.bsd.lv> X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: When the stdout stream gets broken, there is no point in reading X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- When the stdout stream gets broken, there is no point in reading any more input files, and it would be misleading to start a parser, because that would show randomly truncated text. Instead, print an error message and exit the program. Issue found by Leah Neukirchen , who was surprised to see half a manpage when her /tmp/ overflew. Modified Files: -------------- mandoc: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/main.c,v retrieving revision 1.301 retrieving revision 1.302 diff -Lmain.c -Lmain.c -u -p -r1.301 -r1.302 --- main.c +++ main.c @@ -484,6 +484,17 @@ main(int argc, char *argv[]) passthrough(resp->file, fd, conf.output.synopsisonly); + if (ferror(stdout)) { + if (tag_files != NULL) { + warn("%s", tag_files->ofn); + tag_unlink(); + tag_files = NULL; + } else + warn("stdout"); + rc = MANDOCLEVEL_SYSERR; + break; + } + if (argc > 1 && curp.outtype <= OUTT_UTF8) { if (curp.outdata == NULL) outdata_alloc(&curp); -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv