From 45f5b3b79c3ae97bda9f0a876ee29c23b38e83dd Mon Sep 17 00:00:00 2001 From: Mark Karpeles Date: Sun, 13 Jun 2021 22:35:47 +0900 Subject: [PATCH] fix https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3119 by ensuring /dev/stdout is writable prior to using it directly --- src/lib/pdfconverter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/pdfconverter.cc b/src/lib/pdfconverter.cc index b0e668339..6c30b896a 100644 --- a/src/lib/pdfconverter.cc +++ b/src/lib/pdfconverter.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -344,7 +345,7 @@ void PdfConverterPrivate::pagesLoaded(bool ok) { lout = settings.out; if (settings.out == "-") { #ifndef Q_OS_WIN32 - if (QFile::exists("/dev/stdout")) + if ((QFile::exists("/dev/stdout")) && (QFileInfo("/dev/stdout").isWritable())) lout = "/dev/stdout"; else #endif