You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Harish Reddy (JIRA)" <ji...@apache.org> on 2014/07/24 23:44:40 UTC

[jira] [Created] (JCR-3799) Setting large binary value on jcr_data property fails

Harish Reddy created JCR-3799:
---------------------------------

             Summary: Setting large binary value on jcr_data property fails
                 Key: JCR-3799
                 URL: https://issues.apache.org/jira/browse/JCR-3799
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-jcr-rmi
    Affects Versions: 2.6.5
         Environment: Any
            Reporter: Harish Reddy


Setting a very large binary value on the jcr_data property fails and throws an an exception at line 187 in the 2.6.5 source (org.apache.jackrabbit.rmi.value.SerializableBinary.java)

This appears to be a problem with converting a long variable into a
int at line 187.

n = stream.read(buffer, 0, Math.min(
    buffer.length, (int) (length - count)));

The problem occurs only when the length of the binary exceeds a number that can't fit in an int (in my test case, length was 3245027213). 

*Other parts of SerializableBinary.java also appear to be casting length to an int, so I'm guessing all instances of this pattern will need to be fixed.*

I'm using 2.6.5, so don't know if the issue exists in earlier 2.x versions as well. This used to work in v 1.5.4. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)