xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r766643 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/fonts/Glyphs.java status.xml
Date Mon, 20 Apr 2009 10:23:33 GMT
Author: vhennebert
Date: Mon Apr 20 10:23:32 2009
New Revision: 766643

URL: http://svn.apache.org/viewvc?rev=766643&view=rev
Log:
Bugfix: glyph names starting with 'u' but not in the 'official' glyph list could cause a StringIndexOutOfBoundsException
because they were parsed as u1234-like unicode values.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java
    xmlgraphics/commons/trunk/status.xml

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java?rev=766643&r1=766642&r2=766643&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/fonts/Glyphs.java Mon Apr 20
10:23:32 2009
@@ -393,10 +393,18 @@
                         pos += 4;
                     }
                 } else if (token.startsWith("u")) {
-                    if (token.length() > 7) {
+                    if (token.length() > 5) {
                         //TODO: Unicode scalar values greater than FFFF are currently not
supported
                         return null;
                     }
+                    if (token.length() < 5) {
+                        /*
+                         * This is not in the form of 'u1234' --probably a
+                         * non-official glyph name that isn't listed in the
+                         * unicode map.
+                         */
+                        return null;
+                    }
                     try {
                         sb.append(hexToChar(token.substring(1, 5)));
                     } catch (NumberFormatException nfe) {

Modified: xmlgraphics/commons/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/status.xml?rev=766643&r1=766642&r2=766643&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/status.xml (original)
+++ xmlgraphics/commons/trunk/status.xml Mon Apr 20 10:23:32 2009
@@ -40,6 +40,10 @@
   </contexts>
   <changes>
     <release version="Trunk" date="n/a">
+      <action context="Code" dev="VH" type="fix">
+        Bugfix: glyph names starting with ‘u’ but not in the ‘official’
glyph list could cause a 
+        StringIndexOutOfBoundsException because they were parsed as u1234-like unicode values.
+      </action>
       <action context="Code" dev="JM" type="add">
         Added 60 seconds expiration for invalid URIs in the image cache to recover from
         temporarily unavailable images.



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


Mime
View raw message