[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5453) ByteCodeHelper.readByteCode won't load classes bigger than a constant size

Strong Liu (JIRA) noreply at atlassian.com
Thu Nov 11 21:38:13 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39090#action_39090 ] 

Strong Liu commented on HHH-5453:
---------------------------------

https://jira.jboss.org/browse/JBPAPP-5409

> ByteCodeHelper.readByteCode won't load classes bigger than a constant size
> --------------------------------------------------------------------------
>
>                 Key: HHH-5453
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5453
>             Project: Hibernate Core
>          Issue Type: Patch
>          Components: core
>    Affects Versions: 3.3.1, 3.5.0.Beta-1, 3.6.0.Beta1
>            Reporter: Marcos Pernambuco
>            Assignee: Steve Ebersole
>             Fix For: 3.6.0.Beta4
>
>         Attachments: ByteCodeHelper.readByteCode.svn.diff
>
>          Time Spent: 13m
>  Remaining Estimate: 0h
>
> Although it is unlikely that a class will have more than 409600 bytes, ByteCodeHelper.readByteCode() will fail in this case.
> The programmer's intention was clear: handle any file size; but he or she forgot to add a call to inputStream.read() at the end of the loop
> ...
> r = inputStream.read( buffer );
> while ( r >= buffer.length ) {
> 	byte[] temp = new byte[ classBytes.length + buffer.length ];
> 	System.arraycopy( classBytes, 0, temp, 0, classBytes.length );
> 	System.arraycopy( buffer, 0, temp, classBytes.length, buffer.length );
> 	classBytes = temp;
>         // THERE SHOULD BE A "r = inputStream.read( buffer )" HERE
> }
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list