[poppler] fofi/FoFiTrueType.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Oct 1 13:33:51 PDT 2014


 fofi/FoFiTrueType.cc |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit a2477da56a4d1c534175940d7c01a9d3db6c72d4
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Oct 1 22:33:11 2014 +0200

    Fix 303287ebdad0de9fb2655c4d7eab627c0045ea04
    
    It may happen that j is bigger than macGlyphNames size, so don't try to access it

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 456de90..4759186 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2006 Takashi Iwai <tiwai at suse.de>
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2007 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright (C) 2008, 2009, 2012 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008, 2009, 2012, 2014 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008 Tomas Are Haavet <tomasare at gmail.com>
 // Copyright (C) 2012 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
@@ -1470,9 +1470,13 @@ void FoFiTrueType::readPostTable() {
 	m = getU8(stringPos, &ok);
 	if (!ok || !checkRegion(stringPos + 1, m)) {
 	  stringIdx = savedStringIdx;
-	  ok = gTrue;
-	  nameToGID->removeInt(macGlyphNames[j]);
-	  nameToGID->add(new GooString(macGlyphNames[0]), i);
+	  if (j < 258) {
+	    ok = gTrue;
+	    nameToGID->removeInt(macGlyphNames[j]);
+	    nameToGID->add(new GooString(macGlyphNames[0]), i);
+	  } else {
+	    goto err;
+	  }
 	} else {
 	  name = new GooString((char *)&file[stringPos + 1], m);
 	  nameToGID->removeInt(name);


More information about the poppler mailing list