summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2012-04-12 22:24:50 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-04-16 19:28:21 +0200
commit19fb9caecb1b265a8b8651e9bcf4b779f593fefd (patch)
tree673b6d799c291c7ae00a2ef810624cd21c04dbcf /utils
parentfa4848eae370437ab1b9863124e9a340830f66c7 (diff)
Fix crash when the destination file does not exist
Issue found by Joel Voss of Leviathan Security Group
Diffstat (limited to 'utils')
-rw-r--r--utils/HtmlOutputDev.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index bd8c6429..2f079889 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1222,14 +1222,16 @@ HtmlOutputDev::~HtmlOutputDev() {
fputs("</BODY>\n</HTML>\n",fContentsFrame);
fclose(fContentsFrame);
}
- if (xml) {
- fputs("</pdf2xml>\n",page);
- fclose(page);
- } else
- if ( !complexMode || xml || noframes )
- {
- fputs("</BODY>\n</HTML>\n",page);
- fclose(page);
+ if (page != NULL) {
+ if (xml) {
+ fputs("</pdf2xml>\n",page);
+ fclose(page);
+ } else
+ if ( !complexMode || xml || noframes )
+ {
+ fputs("</BODY>\n</HTML>\n",page);
+ fclose(page);
+ }
}
if (pages)
delete pages;