limit allocation when BSER arrays claim they have more elements in the array than...
commit216bd70fd6f2609dee49a523a1c5b5250fa70ff8
authorChad Austin <chadaustin@meta.com>
Sat, 1 Oct 2022 00:12:09 +0000 (30 17:12 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 1 Oct 2022 00:12:09 +0000 (30 17:12 -0700)
tree3866a5d3e608c955be26a951d832d9b52bb4c8e9
parent42db33e4c1252bf61478b762eda922176ca05c74
limit allocation when BSER arrays claim they have more elements in the array than bytes remaining in the document

Summary:
It's possible for BSER arrays to claim they have more elements than
remaining bytes. BSER requires that every value consume at least one
byte of the input document, so this is impossible. In those cases,
fail early rather than allocate storage.

Reviewed By: kmancini

Differential Revision: D39824503

fbshipit-source-id: 2b2cba9514033d022444de73a02041919c9464ca
third-party/watchman/src/watchman/python/pywatchman/bser.c