poppler/Lexer.cc  |    2 +-
 poppler/PDFDoc.cc |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 1aaf621f511ca4c235cb30a5ddbf050acd30fe91
Author: Ben Timby <bti...@gmail.com>
Date:   Mon Jan 8 23:42:40 2018 +0100

    Check return code of getChar(), abort reading on error.
    
    Bug #104502

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index a259f4b9..8fca2020 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -37,6 +37,7 @@
 // Copyright (C) 2016 Jakub Alba <jakuba...@gmail.com>
 // Copyright (C) 2017 Jean Ghali <jgh...@libertysurf.fr>
 // Copyright (C) 2017 Fredrik Fornwall <fred...@fornwall.net>
+// Copyright (C) 2018 Ben Timby <bti...@gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -401,11 +402,16 @@ void PDFDoc::checkHeader() {
   char *p;
   char *tokptr;
   int i;
+  int c;
 
   pdfMajorVersion = 0;
   pdfMinorVersion = 0;
   for (i = 0; i < headerSearchSize; ++i) {
-    hdrBuf[i] = str->getChar();
+    if ((c = str->getChar()) == EOF) {
+      error(errSyntaxWarning, -1, "EOF while reading header (continuing 
anyway)");
+      return;
+    }
+    hdrBuf[i] = c;
   }
   hdrBuf[headerSearchSize] = '\0';
   for (i = 0; i < headerSearchSize - 5; ++i) {
commit ad7f6acd3c643b5bc0c9b7f91616f678b178a041
Author: Albert Astals Cid <aa...@kde.org>
Date:   Mon Jan 8 23:40:25 2018 +0100

    (C) of last commit

diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index 3089da38..2ed197d1 100644
--- a/poppler/Lexer.cc
+++ b/poppler/Lexer.cc
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2006-2010, 2012-2014, 2017 Albert Astals Cid <aa...@kde.org>
+// Copyright (C) 2006-2010, 2012-2014, 2017, 2018 Albert Astals Cid 
<aa...@kde.org>
 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalc...@gmail.com>
 // Copyright (C) 2010 Carlos Garcia Campos <carlo...@gnome.org>
 // Copyright (C) 2012, 2013 Adrian Johnson <ajohn...@redneon.com>
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to