Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1247

Parsing short relative hyper refrences in jar packed svg files causes java.lang.IndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.10
    • None
    • Utilities
    • None

    Description

      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:

       

      <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>
      

       

       

      Point of failure:

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

      String start = urlStr.substring(0, JAR.length()+1).toLowerCase();
      

       

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

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Yeitijem Mario Förster
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified