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

ServletInputStreamImpl.read and close can throw NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 2.3.19.Final
    • None
    • None
    • None

      Because the class is deliberately unsychronized, the buffer pool could be null after it has been checked for null, resulting a NPE like the one we are seeing in CI failure (UNDERTOW-2400):

      Error:  testAsyncRespondBeforeRead(io.undertow.servlet.test.response.writer.ResponseWriterTestCase)  Time elapsed: 113.969 s  <<< ERROR!
      java.lang.NullPointerException
      	at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:202)
      	at io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:176)
      	at io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:162)
      	at io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:153)
      	at jakarta.servlet.ServletInputStream.readLine(ServletInputStream.java:81)
      	at io.undertow.servlet.test.response.writer.AsyncResponseWriterOnPostServlet.lambda$doPost$0(AsyncResponseWriterOnPostServlet.java:48)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

            flaviarnn Flavia Rainone
            flaviarnn Flavia Rainone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: