From 978ef8c99be2cb0eeb9a772bec427b0d5041cd21 Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Thu, 21 Dec 2006 19:54:40 +0000 Subject: [PATCH] Avoid reading beyond the end of the file. This fixes bug 41117. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_93@489450 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/truetype/FontFileReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java index 4f906a006..42049eaac 100644 --- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java +++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java @@ -82,7 +82,7 @@ public class FontFileReader { * @throws IOException In case of an I/O problem */ public void seekSet(long offset) throws IOException { - if (offset > fsize || offset < 0) { + if (offset >= fsize || offset < 0) { throw new java.io.EOFException("Reached EOF, file size=" + fsize + " offset=" + offset); } @@ -134,7 +134,7 @@ public class FontFileReader { * @throws IOException If EOF is reached */ public byte read() throws IOException { - if (current > fsize) { + if (current >= fsize) { throw new java.io.EOFException("Reached EOF, file size=" + fsize); } -- 2.39.5