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

URIMappingInterceptor and ArrayIndexOutOfBounds Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4
    • 2.4.1, 2.3.5
    • Core
    • Tomcat 6.0.32, CXF 2.4, JDK 1.6.0_23

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: