]
Galder Zamarreño updated HRJS-10:
---------------------------------
Summary: Buffers and String offsets not updated when writing length (was: Buffer
extension could lead to String truncation)
Buffers and String offsets not updated when writing length
----------------------------------------------------------
Key: HRJS-10
URL:
https://issues.jboss.org/browse/HRJS-10
Project: Infinispan Javascript client
Issue Type: Bug
Reporter: Galder Zamarreño
Priority: Critical
When encoding a String, there's a chance that there's a need to extend the size
of the buffer if the String won't fit the buffer. However, when calculating whether
extending is required, only the String size is counted without counting the num bytes
counter at the start. As a result of that, a String might end up being truncated and lead
to operation hanging up.
This happened in executing a Script where the number of bytes sent as message ID was
bigger than 27 and the script name being executed was exactly 23 characters.