You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/06/26 15:51:46 UTC

svn commit: r1862151 - /pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java

Author: tilman
Date: Wed Jun 26 15:51:46 2019
New Revision: 1862151

URL: http://svn.apache.org/viewvc?rev=1862151&view=rev
Log:
PDFBOX-4579: avoid IndexOutOfBoundsException, as suggested by Joakim Nilsson

Modified:
    pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java

Modified: pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java?rev=1862151&r1=1862150&r2=1862151&view=diff
==============================================================================
--- pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java (original)
+++ pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java Wed Jun 26 15:51:46 2019
@@ -94,7 +94,7 @@ public class WindowsFontDirFinder implem
         }
         File osFontsDir;
         File psFontsDir;
-        if (windir != null)
+        if (windir != null && windir.length() > 2)
         {
             // remove any trailing '/'
             if (windir.endsWith("/"))