|
|
9ae3ca |
From 60b4fe65bc9dc9b82bbadf0be2e3781be796a13d Mon Sep 17 00:00:00 2001
|
|
|
9ae3ca |
From: Albert Astals Cid <aacid@kde.org>
|
|
|
9ae3ca |
Date: Tue, 1 May 2018 02:46:17 +0200
|
|
|
9ae3ca |
Subject: FoFiType1C::cvtGlyph: Fix infinite recursion on malformed documents
|
|
|
9ae3ca |
|
|
|
9ae3ca |
Bugs #104942, #103238
|
|
|
9ae3ca |
---
|
|
|
9ae3ca |
fofi/FoFiType1C.cc | 7 ++++---
|
|
|
9ae3ca |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
9ae3ca |
|
|
|
9ae3ca |
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
|
|
|
9ae3ca |
index 03e7799..b14561f 100644
|
|
|
9ae3ca |
--- a/fofi/FoFiType1C.cc
|
|
|
9ae3ca |
+++ b/fofi/FoFiType1C.cc
|
|
|
9ae3ca |
@@ -13,7 +13,7 @@
|
|
|
9ae3ca |
// All changes made under the Poppler project to this file are licensed
|
|
|
9ae3ca |
// under GPL version 2 or later
|
|
|
9ae3ca |
//
|
|
|
9ae3ca |
-// Copyright (C) 2009, 2010 Albert Astals Cid <aacid@kde.org>
|
|
|
9ae3ca |
+// Copyright (C) 2009, 2010, 2017, 2018 Albert Astals Cid <aacid@kde.org>
|
|
|
9ae3ca |
// Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
|
9ae3ca |
//
|
|
|
9ae3ca |
// To see a description of the changes please see the Changelog file that
|
|
|
9ae3ca |
@@ -32,6 +32,7 @@
|
|
|
9ae3ca |
#include <math.h>
|
|
|
9ae3ca |
#include "goo/gmem.h"
|
|
|
9ae3ca |
#include "goo/gstrtod.h"
|
|
|
9ae3ca |
+#include "goo/GooLikely.h"
|
|
|
9ae3ca |
#include "goo/GooString.h"
|
|
|
9ae3ca |
#include "FoFiEncodings.h"
|
|
|
9ae3ca |
#include "FoFiType1C.h"
|
|
|
9ae3ca |
@@ -1361,7 +1362,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
|
|
|
9ae3ca |
--nOps;
|
|
|
9ae3ca |
ok = gTrue;
|
|
|
9ae3ca |
getIndexVal(subrIdx, k, &val, &ok;;
|
|
|
9ae3ca |
- if (ok) {
|
|
|
9ae3ca |
+ if (likely(ok && val.pos != offset)) {
|
|
|
9ae3ca |
cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
|
|
|
9ae3ca |
}
|
|
|
9ae3ca |
} else {
|
|
|
9ae3ca |
@@ -1596,7 +1597,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
|
|
|
9ae3ca |
--nOps;
|
|
|
9ae3ca |
ok = gTrue;
|
|
|
9ae3ca |
getIndexVal(&gsubrIdx, k, &val, &ok;;
|
|
|
9ae3ca |
- if (ok) {
|
|
|
9ae3ca |
+ if (likely(ok && val.pos != offset)) {
|
|
|
9ae3ca |
cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
|
|
|
9ae3ca |
}
|
|
|
9ae3ca |
} else {
|
|
|
9ae3ca |
--
|
|
|
9ae3ca |
cgit v1.1
|
|
|
9ae3ca |
|