Bug 748813

Summary: Null Pointer Exception if client provides no data with a chunked POST request
Product: Red Hat Enterprise Linux 6 Reporter: Julio Entrena Perez <jentrena>
Component: tomcat6Assignee: David Knox <dknox>
Status: CLOSED ERRATA QA Contact: Michal Haško <mhasko>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2CC: azelinka, chorn, jclere, jdennis, jentrena, mhasko, pslavice, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 14:41:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 727267, 756082    
Attachments:
Description Flags
Proposed patch
none
Proposed patch
none
Reproducer none

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