Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-3175

InputContextImpl: cannot upload file larger than 2GB

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.10, 2.3.5
    • Fix Version/s: 2.2.11, 2.3.6
    • Component/s: jackrabbit-webdav
    • Labels:
      None
    • Environment:
      Not applicable

      Description

      If an entity is larger than 2GB, the Content-Length cannot be obtained by using getIntHeader because of integer overflow. One needs to parse the value of the header from string to long. This issue affects InputContextImpl.getContentLength() in org.apache.jackrabbit.webdav.io from webdav/java (the current behavior is that the header is converted from string to int by the servlet API, then from int to long by Jackrabbit)

      Testcase: largefile from Litmus. (test 3 - large_put fails when the PUT request is received)

      1. patch
        0.8 kB
        Javier Godoy

        Activity

        Javier Godoy created issue -
        Javier Godoy made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Fix Version/s 2.3.6 [ 12319192 ]
        Javier Godoy made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Javier Godoy made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Javier Godoy made changes -
        Attachment patch [ 12506977 ]
        Javier Godoy made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Javier Godoy made changes -
        Comment [ Index: J:/lib/jackrabbit-trunk/webdav/java/org/apache/jackrabbit/webdav/io/InputContextImpl.java
        ===================================================================
        --- J:/lib/jackrabbit-trunk/webdav/java/org/apache/jackrabbit/webdav/io/InputContextImpl.java (revision 1180566)
        +++ J:/lib/jackrabbit-trunk/webdav/java/org/apache/jackrabbit/webdav/io/InputContextImpl.java (working copy)
        @@ -71,8 +71,8 @@
             }
         
             public long getContentLength() {
        - int length = request.getIntHeader(DavConstants.HEADER_CONTENT_LENGTH);
        - return Long.parseLong(length + "");
        + String length = request.getHeader(DavConstants.HEADER_CONTENT_LENGTH);
        + return length==null?-1:Long.parseLong(length);
             }
         
             public String getContentType() {
        ]
        Javier Godoy made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Julian Reschke made changes -
        Assignee Julian Reschke [ reschke ]
        Julian Reschke committed 1213276 (1 file)
        Reviews: none

        JCR-3175: InputContextImpl: cannot upload file larger than 2GB

        Avoid truncating Content-Length to int by bypassing getIntHeader API

        Hide
        Julian Reschke added a comment -

        Patch applied with additional exception handling; thanks Javier,

        Show
        Julian Reschke added a comment - Patch applied with additional exception handling; thanks Javier,
        Julian Reschke made changes -
        Status Patch Available [ 10002 ] In Progress [ 3 ]
        Affects Version/s 2.4 [ 12318241 ]
        Affects Version/s 2.3.6 [ 12319192 ]
        Fix Version/s 2.4 [ 12318241 ]
        Fix Version/s 2.3.6 [ 12319192 ]
        Julian Reschke made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jukka Zitting made changes -
        Fix Version/s 2.3.6 [ 12319192 ]
        Fix Version/s 2.4 [ 12318241 ]
        Jukka Zitting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Jukka Zitting added a comment -

        Merged to the 2.2 branch in revision 1235791.

        Show
        Jukka Zitting added a comment - Merged to the 2.2 branch in revision 1235791.
        Jukka Zitting made changes -
        Fix Version/s 2.2.11 [ 12319082 ]
        Affects Version/s 2.3.5 [ 12319164 ]
        Affects Version/s 2.2.10 [ 12318249 ]
        Affects Version/s 2.4 [ 12318241 ]

          People

          • Assignee:
            Julian Reschke
            Reporter:
            Javier Godoy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 10m
              10m
              Remaining:
              Remaining Estimate - 10m
              10m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development