Mario Förster created BATIK-1247:
------------------------------------

             Summary: Parsing short relative hyper refrences in jar packed svg 
files causes java.lang.IndexOutOfBoundsException
                 Key: BATIK-1247
                 URL: https://issues.apache.org/jira/browse/BATIK-1247
             Project: Batik
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.10
            Reporter: Mario Förster


If there is a short relative hyper refrence less four chars length in total 
within a svg file which is packed into a jar file. Loading it will cause an 
java.lang.IndexOutOfBoundsException to be thrown.

example file:

 
{code:java|bgColor=#efefef}
<svg xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="320" height="320" viewBox="0 
0 320 320" stroke-linecap="round" stroke="#000">
  <defs>
    <path id="r" d="m160,160l0,0 0,0">
    </path>
  </defs>
  <use xlink:href="#r"/>
</svg>
{code}
 

 

Point of failure:

org.apache.batik.util.ParsedURLJarProtocolHandler - parseURL Method

{code:java}
String start = urlStr.substring(0, JAR.length()+1).toLowerCase();
{code}
 

Problem should be solved by adding an additional check within 
org.apache.batik.util.ParsedURLJarProtocolHandler 's parseURL method or by 
using {color:#f79232}startsWith{color} string method ...

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to