Bug 745840 (EDG-41)

Summary: MemcachedValue Externalizer uses Byte to store array length
Product: [JBoss] JBoss Data Grid 5 Reporter: Michal Linhard <mlinhard>
Component: InfinispanAssignee: Default User <jbpapp-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: galder.zamarreno, nobody, rhusar
Target Milestone: ---   
Target Release: EAP 5.1.0 EDG TP   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/EDG-41
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-13 15:12:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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