Bug 748813 - Null Pointer Exception if client provides no data with a chunked POST request
Summary: Null Pointer Exception if client provides no data with a chunked POST request
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.2
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: Michal Haško
URL:
Whiteboard:
Depends On:
Blocks: 727267 756082
TreeView+ depends on / blocked
 
Reported: 2011-10-25 12:55 UTC by Julio Entrena Perez
Modified: 2018-11-27 21:16 UTC (History)
8 users (show)

Fixed In Version: tomcat6-6.0.24-38.el6
Doc Type: Bug Fix
Doc Text:
Patch adds a check for form data before processing. If request body length is zero, null is returned without further processiong
Clone Of:
Environment:
Last Closed: 2012-06-20 14:41:13 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed patch (775 bytes, patch)
2011-10-25 13:12 UTC, Julio Entrena Perez
no flags Details | Diff
Proposed patch (849 bytes, patch)
2011-10-26 17:15 UTC, Julio Entrena Perez
no flags Details | Diff
Reproducer (2.71 KB, application/x-gzip)
2011-10-26 21:18 UTC, David Knox
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 49424 0 None None None Never
Red Hat Product Errata RHBA-2012:0945 0 normal SHIPPED_LIVE tomcat6 bug fix and enhancement update 2012-06-19 21:00:00 UTC

Description Julio Entrena Perez 2011-10-25 12:55:53 UTC
Description of problem:
Using the URL class coupled with setChunkedStreamingMode  results in:

SEVERE: java.lang.NullPointerException
    at
org.apache.catalina.connector.Request.readChunkedPostBody(Request.java:2632)

Version-Release number of selected component (if applicable):


How reproducible:
Always.

Steps to Reproduce:
1.
    public void connectWithChunking() throws IOException {

        HttpURLConnection conn = getConnection();

        conn.setChunkedStreamingMode(8 * 1024);

        InputStream is = conn.getInputStream();

        assertNotNull(is);

    }

2.
3.
  
Actual results:
SEVERE: java.lang.NullPointerException
    at
org.apache.catalina.connector.Request.readChunkedPostBody(Request.java:2632)

Expected results:
No null pointer exception.

Additional info:
Fixed upstream at http://svn.apache.org/viewvc?view=revision&revision=955665 .
Tracked upstream at https://issues.apache.org/bugzilla/show_bug.cgi?id=49424 .

Comment 1 Julio Entrena Perez 2011-10-25 13:12:16 UTC
Created attachment 530078 [details]
Proposed patch

Comment 2 David Knox 2011-10-25 21:31:43 UTC
Fixed in el6. Patch is not checked yet.

Comment 3 Julio Entrena Perez 2011-10-26 17:15:11 UTC
Created attachment 530337 [details]
Proposed patch

Comment 4 David Knox 2011-10-26 21:18:26 UTC
Created attachment 530384 [details]
Reproducer

Comment 11 Michal Haško 2012-01-06 11:30:31 UTC
giving qa_ack+ reproducer exists

Comment 12 Christian Horn 2012-01-06 11:40:05 UTC
Asked cusatomer for exact package and if reproducer is available.

Comment 23 David Knox 2012-05-01 18:38:11 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Patch adds a check for form data before processing. If request body length is zero, null is returned without further processiong

Comment 26 errata-xmlrpc 2012-06-20 14:41:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0945.html


Note You need to log in before you can comment on or make changes to this bug.