[poppler] 2 commits - poppler/Lexer.cc poppler/PDFDoc.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jan 8 22:43:00 UTC 2018


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

New commits:
commit 1aaf621f511ca4c235cb30a5ddbf050acd30fe91
Author: Ben Timby <btimby at 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 <jakubalba at gmail.com>
 // Copyright (C) 2017 Jean Ghali <jghali at libertysurf.fr>
 // Copyright (C) 2017 Fredrik Fornwall <fredrik at fornwall.net>
+// Copyright (C) 2018 Ben Timby <btimby at 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 <aacid at 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 <aacid at kde.org>
+// Copyright (C) 2006-2010, 2012-2014, 2017, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright (C) 2010 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2012, 2013 Adrian Johnson <ajohnson at redneon.com>


More information about the poppler mailing list