Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
qpid-cpp-1.39.0
-
None
-
None
Description
The encoder will use a more compact map8 encoding if it can write out a map that way. The wire representation of the map is:
size_of_count_and_data
count
data
Where the first two are 8 bits each for a map8 and 32 bits each for a map32.
The test to switch between map8 and map32 neglects to factor in the additional "count" byte, but does add the extra byte and size while writing the encoding. This can result in using a map with size of 255 (excluding the count), deciding to use map8 encoding, and then writing a size_of_count_and_data of zero (uint8_t: 255 + 1).