Ticket #704 (new Bug)

Opened 2 years ago

Serialize object from client to server cause java.nio.BufferUnderflowException

Reported by: elektro Owned by: paul
Priority: Major Component: App Server
Version: 0.9.0 RC1 Keywords: serialize input BufferUnderflowException
Cc:

Description

This bug is easy to reproduce. send from flash client a array that contains two array that contains a empty array and a empty arraycollection and a empty array. in the second array the same:

array[2]=

array[3]{array[0],arraycollection[0],array[0]},
array[3]{array[0],arraycollection[0],array[0]}

. You get a BufferUnderflowException.

This is because in Input.java add in classReferences classes that not are inline.
This is easy to patch. simply put
if(inlineClass)
classReferences.add(new ClassReference(className,AMF3.%type%, attributes));

in any site that classReferences.add appear.

i think is better put only one in the top of object serialization but with this work for me.

in 0.9.1 i found another bug that is in the near line 655 in
case AMF3.TYPE_OBJECT_VALUE:

if you send a empty object from client then classReferences add two times the class. in the line 666 and the line 680

sorry for my english :-)

Note: See TracTickets for help on using tickets.