Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-262

java.lang.IndexOutOfBoundsException in HttpRequestParser.handleCachedHeader

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • 1.0.14.Final
    • 1.0.6.Final
    • Core
    • None

      I experience random BadRequest using WildFly. I found the problem in io.undertow.server.protocol.http.HttpRequestParser:761 the exception is:

      java.lang.IndexOutOfBoundsException
      at java.nio.Buffer.checkIndex(Buffer.java:532)
      at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
      at io.undertow.server.protocol.http.HttpRequestParser.handleCachedHeader(HttpRequestParser.java:761)
      at io.undertow.server.protocol.http.HttpRequestParser.handleHeaderValue(HttpRequestParser.java:636)
      at io.undertow.server.protocol.http.HttpRequestParser.handle(HttpRequestParser.java:253)
      at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:133)
      at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:91)
      at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:45)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:539)

      The exception is raised from handleCachedHeader function on line 761:

      int next = buffer.get(pos + i);

      where the pos + i is equals to buffer.limit().

      I tryed to understand what the function do, but I cloud not.

        1. Debug1.png
          243 kB
          Briganti Domenico

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              dometec Briganti Domenico (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: