Skip to content
Commit 3c091032 authored by Sam McCall's avatar Sam McCall
Browse files

[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
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment