Validate collection sizes before allocating

Merged
RO
1mo ago
+87-20

Validate cases where (in particular) a few bytes of server data determines the size of a collection allocated, and throw if it's not possible based on the size of the buffer that the collection is purported to be contained in.