msgpack icon indicating copy to clipboard operation
msgpack copied to clipboard

Memory allocation in EXT32

Open WernherVonData opened this issue 2 years ago • 0 comments

Hello, I was debugging the decoding code and get some thought regarding EXT32 format: is it necessary to allocate the table of 2^32-1 bytes ad hoc before reading the rest of the bytes?

What if the data payload will be just few bytes? The allocation is done earlier and over 1GB of memory is used on JVM - that is a waste. Such approach open potential vulnerability on client side of the library that message this kind will be passed. Was such concern was thought earlier? Is it responsibility on the client side to "know" what is he going to decode? Don't know if someone else see this situation in a similiar way.

WernherVonData avatar Jul 27 '23 19:07 WernherVonData