xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spepp...@apache.org
Subject svn commit: r489450 - /xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
Date Thu, 21 Dec 2006 19:54:40 GMT
Author: spepping
Date: Thu Dec 21 11:54:40 2006
New Revision: 489450

URL: http://svn.apache.org/viewvc?view=rev&rev=489450
Log:
Avoid reading beyond the end of the file. This fixes bug 41117.

Modified:
    xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java

Modified: xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java?view=diff&rev=489450&r1=489449&r2=489450
==============================================================================
--- xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
(original)
+++ xmlgraphics/fop/branches/fop-0_93/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
Thu Dec 21 11:54:40 2006
@@ -82,7 +82,7 @@
      * @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 @@
      * @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);
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message