[clangd] Sanity-check array sizes read from disk before allocating them.
Previously a corrupted index shard could cause us to resize arrays to an arbitrary int32. This tends to be a huge number, and can render the system unresponsive. Instead, cap this at the amount of data that might reasonably be read (e.g. the #bytes in the file). If the specified length is more than that, assume the data is corrupt. Differential Revision: https://reviews.llvm.org/D91258
Loading
Please sign in to comment