From d41af23a6c879fe2b5f88e40e0ad87db099a23cf Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Thu, 18 Nov 2021 14:54:50 -0800 Subject: [PATCH] Fix heap use after free in progress-bar.cc Fix some heap-use-after-free in progress-bar.cc These are somewhat tricky failures here due to temporary variable creation and string_view --- src/libmain/progress-bar.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index 63955eed1..f4306ab91 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -11,7 +11,7 @@ namespace nix { -static std::string getS(const std::vector & fields, size_t n) +static std::string_view getS(const std::vector & fields, size_t n) { assert(n < fields.size()); assert(fields[n].type == Logger::Field::tString);