summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2014-04-06 15:49:18 +0200
committerAlbert Astals Cid <aacid@kde.org>2014-04-06 16:08:15 +0200
commit8810b8917fded340b784873a91ca025b0bb49f3d (patch)
tree523bd6a881f4a86f4b6adfc5b3d04eaef744d261
parent9309907673e8557a25021dce79d9b4354640e2d0 (diff)
Fix Out-of-bounds read
CID #16844
-rw-r--r--poppler/PageLabelInfo_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/poppler/PageLabelInfo_p.h b/poppler/PageLabelInfo_p.h
index d3cd89f9..6cd5220d 100644
--- a/poppler/PageLabelInfo_p.h
+++ b/poppler/PageLabelInfo_p.h
@@ -3,7 +3,7 @@
// This file is under the GPLv2 or later license
//
// Copyright (C) 2005-2006 Kristian Høgsberg <krh@redhat.com>
-// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2005, 2009, 2014 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2011 Simon Kellner <kellner@kit.edu>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
//
@@ -15,6 +15,7 @@
/* http://mathworld.wolfram.com/RomanNumerals.html */
#include "goo/GooString.h"
+#include "Error.h"
static int fromRoman(const char *buffer) {
int digit_value, prev_digit_value, value;
@@ -73,6 +74,11 @@ static void toRoman(int number, GooString *str, GBool uppercase) {
int i, j, k;
const char *wh;
+ if (number >= 4000) {
+ error(errUnimplemented, -1, "Conversion to roman numberals of numbers >= 4000 not implemented");
+ return;
+ }
+
if (uppercase)
wh = uppercaseNumerals;
else