From e46aa5b08f478c027c510ec9a5ba0412ef81c5c8 Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Sun, 28 Mar 2021 23:47:51 -0700 Subject: [PATCH] Report uninitialized memory drop on panic in telemetry --- crates/telemetry/RUSTSEC-0000-0000.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 crates/telemetry/RUSTSEC-0000-0000.md diff --git a/crates/telemetry/RUSTSEC-0000-0000.md b/crates/telemetry/RUSTSEC-0000-0000.md new file mode 100644 index 0000000..aca5429 --- /dev/null +++ b/crates/telemetry/RUSTSEC-0000-0000.md @@ -0,0 +1,21 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "telemetry" +date = "2021-02-17" +url = "https://github.com/Yoric/telemetry.rs/issues/45" +categories = ["memory-corruption"] +keywords = ["memory-safety"] + +[versions] +patched = [] +``` + +# misc::vec_with_size() can drop uninitialized memory if clone panics + +`misc::vec_with_size` creates a vector of the provided `size` and immediately +calls `vec.set_len(size)` on it, initially filling it with uninitialized memory. +It then inserts elements using `vec[i] = value.clone()`. + +If the `value.clone()` call panics, uninitialized items in the vector will be +dropped leading to undefined behavior.