Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3480

URIMappingInterceptor and ArrayIndexOutOfBounds Error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1, 2.3.5
    • Component/s: Core
    • Labels:
    • Environment:

      Tomcat 6.0.32, CXF 2.4, JDK 1.6.0_23

    • Estimated Complexity:
      Novice

      Description

      URIMappingInterceptor keeps throwing ArrayIndexOutOfBounds error.

      Method: getQueries
      Statement (318): queries.put(keyValue[0], uriDecode(keyValue[1]));

      Proposed Fix
      Change from:

              if (!StringUtils.isEmpty(query)) {            
                  List<String> parts = Arrays.asList(query.split("&"));
                  for (String part : parts) {
                      String[] keyValue = part.split("=");
                      queries.put(keyValue[0], uriDecode(keyValue[1]));
                  }
                  return queries;
              }
      

      Change to:

              if (!StringUtils.isEmpty(query)) { 
                  List<String> parts = Arrays.asList(query.split("&"));
                  for (String part : parts) {
                     if (part.contains("=")) {
                         String[] keyValue = part.split("=");
                         queries.put(keyValue[0], uriDecode(keyValue[1]));
                     }
                  }
                  return queries;
              }
      

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Yue Fang
              Reporter:
              rdgrimes Ron Grimes
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: