Bug 745840 (EDG-41) - MemcachedValue Externalizer uses Byte to store array length
Summary: MemcachedValue Externalizer uses Byte to store array length
Keywords:
Status: CLOSED NEXTRELEASE
Alias: EDG-41
Product: JBoss Data Grid 5
Classification: JBoss
Component: Infinispan
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: EAP 5.1.0 EDG TP
Assignee: Default User
QA Contact:
URL: http://jira.jboss.org/jira/browse/EDG-41
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-07 12:18 UTC by Michal Linhard
Modified: 2014-03-17 04:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-13 15:12:23 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker EDG-41 0 None None None Never

Description Michal Linhard 2010-12-07 12:18:40 UTC
project_key: EDG

infinispan 4.2.0.CR3

https://github.com/infinispan/infinispan/blob/4.2.0.CR3/server/memcached/src/main/scala/org/infinispan/server/memcached/MemcachedValue.scala
line 33 and 40
byte array length is written and read as byte and therefore MemcachedValue is marshalled incorrectly for byte arrays longer than Byte.MAX_VALUE
I tested this using writeInt() and readInt() methods instead:
 output.writeInt(cacheValue.data.length)
 val data = new Array[Byte](input.readInt())
and it worked fine.

Comment 1 Galder Zamarreño 2010-12-09 15:32:20 UTC
Indeed, should be the same as ByteArrayKey, which already uses writeInt and readInt.

Thanks for spotting it Michal!

Comment 2 Galder Zamarreño 2010-12-09 16:29:17 UTC
Link: Added: This issue depends ISPN-829


Comment 3 Anne-Louise Tangring 2011-10-11 17:05:46 UTC
Affects Testing: Removed: Blocks Testing 



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