From 7e540059a33536517a508ffef323f6c88c61fad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 15:43:39 +0100 Subject: [PATCH] git/getStringUntil: fix uninitialized stack variable at least clang-tidy is not convinced that this initialized. If this is not the case, the impact should be small and hopefully also more robust if changed. --- src/libutil/git.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/git.cc b/src/libutil/git.cc index 3303dbc32..a3be66429 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -33,7 +33,7 @@ std::optional decodeMode(RawMode m) { static std::string getStringUntil(Source & source, char byte) { std::string s; - char n[1]; + char n[1] = { 0 }; source(std::string_view { n, 1 }); while (*n != byte) { s += *n;