fix: limit how deep AMF3 arrays nest and stop at the end of the data

The AMF3 reader read an array inside an array to any depth and kept
reading values after the data had ended. It now refuses arrays nested
more than 64 deep and throws when the data ends before a value does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 13:02:05 -06:00
parent 9ffed42772
commit a235e57975
3 changed files with 72 additions and 7 deletions

View File

@@ -79,7 +79,9 @@ private:
*/
std::vector<std::string> accessedElements;
// How deeply nested the array being read is.
/**
* How many arrays are being read at the moment, each one inside the one before it.
*/
uint32_t m_Depth = 0;
// How many values have been read so far.