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

filename with ";" in file upload throws StringIndexOutOfBoundsException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.7
    • Fix Version/s: 3.0.0-milestone1, 2.7.8
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Stacktrace

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
              at java.lang.String.substring(String.java:1937)
              at org.apache.cxf.attachment.AttachmentUtil.createAttachment(AttachmentUtil.java:311)
              at org.apache.cxf.attachment.AttachmentDeserializer.createAttachment(AttachmentDeserializer.java:289)
              at org.apache.cxf.attachment.AttachmentDeserializer.readNext(AttachmentDeserializer.java:192)
              at org.apache.cxf.attachment.LazyAttachmentCollection.loadAll(LazyAttachmentCollection.java:55)
              at org.apache.cxf.attachment.LazyAttachmentCollection.size(LazyAttachmentCollection.java:120)
              at org.apache.cxf.jaxrs.ext.MessageContextImpl.createAttachments(MessageContextImpl.java:281)
              at org.apache.cxf.jaxrs.ext.MessageContextImpl.get(MessageContextImpl.java:77)
              at org.apache.cxf.jaxrs.impl.tl.ThreadLocalMessageContext.get(ThreadLocalMessageContext.java:38)
              at org.apache.cxf.jaxrs.utils.multipart.AttachmentUtils.getMultipartBody(AttachmentUtils.java:115)
              at org.apache.cxf.jaxrs.utils.multipart.AttachmentUtils.getAttachments(AttachmentUtils.java:120)
              at org.apache.cxf.jaxrs.provider.MultipartProvider.readFrom(MultipartProvider.java:147)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1288)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1239)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:790)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:749)
              at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:236)
              at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:101)
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
              at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
              at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
              at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:681)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
              at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1782)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      

      Will add logging later

        Attachments

        1. cxf-exception-clientside.log
          8 kB
          Denis Koelewijn
        2. cxf-exception-serverside.log
          11 kB
          Denis Koelewijn

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              denisk Denis Koelewijn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: