[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
parent
69ca17a9
Please register or sign in to comment